[SCM] Samba Shared Repository - branch master updated

Björn Jacke bjacke at samba.org
Fri Sep 7 14:22:02 MDT 2012


The branch, master has been updated
       via  cd93c7d waf: add tests for NFS quota stuff
       via  992908a waf: add test for HAVE_DQB_FSOFTLIMIT
       via  58f6247 waf: make checks for different XFS flavours
       via  a7f0a07 s3:autoconf: look for irix xfs only when if we didn't find the Linux one before
       via  abf98e3 s3:sysquota_nfs: fix build on Tru64 et alii
       via  0c0441b rpcserver: fix useless declaration warning
       via  31e58a1 s3:sysquota-test: include ufs/ufs/quota.h only when found
       via  5c3769b build: define _BSD_TYPES on IRIX to have types like u_short
      from  ee2d6ae s3:quota: clean up and consolidate the xfs quota checks and defines

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit cd93c7d055232f1eb0d4de92066fd5eb5f9e5ff1
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 20:41:58 2012 +0200

    waf: add tests for NFS quota stuff
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Fri Sep  7 22:21:55 CEST 2012 on sn-devel-104

commit 992908a3dabd9d3c966564db040f0e4f4f2cfe25
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 20:02:03 2012 +0200

    waf: add test for HAVE_DQB_FSOFTLIMIT

commit 58f6247c79de329ea19cdc1f131ed3f49f552fd7
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 19:49:25 2012 +0200

    waf: make checks for different XFS flavours

commit a7f0a07a05a38a371fef67f5611d2089713d4d4b
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 19:28:12 2012 +0200

    s3:autoconf: look for irix xfs only when if we didn't find the Linux one before

commit abf98e32899194f6b8ce603e80596f39fee5cc2b
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 17:35:41 2012 +0200

    s3:sysquota_nfs: fix build on Tru64 et alii
    
    the old Unix world put the struct rquota directly into the getquota_rslt
    struct, the new Unix world puts a getquota_rslt_u union in between and they
    decided to rename the status struct member.

commit 0c0441bd4550adb864baa0c36a201d273a24b75e
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 16:19:52 2012 +0200

    rpcserver: fix useless declaration warning
    
    issues by irix compiler

commit 31e58a1fcea6e870eae1aa4b5dfb807bce97cf74
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 15:59:16 2012 +0200

    s3:sysquota-test: include ufs/ufs/quota.h only when found

commit 5c3769b056ee0e7c2243907dc87714587695ea2a
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 7 15:56:15 2012 +0200

    build: define _BSD_TYPES on IRIX to have types like u_short
    
    why the hell do IRIX systems headers like quota.h use types that are available
    only with such a define...?

-----------------------------------------------------------------------

Summary of changes:
 lib/replace/libreplace_cc.m4    |    1 +
 lib/replace/wscript             |    1 +
 source3/configure.in            |    5 +++-
 source3/lib/sysquotas_nfs.c     |   54 ++++++++++++++++++++++----------------
 source3/rpc_server/rpc_server.h |    1 -
 source3/tests/sysquotas.c       |    2 +
 source3/wscript                 |   32 +++++++++++++++++++++--
 7 files changed, 68 insertions(+), 28 deletions(-)
 mode change 100755 => 100644 source3/wscript


Changeset truncated at 500 lines:

diff --git a/lib/replace/libreplace_cc.m4 b/lib/replace/libreplace_cc.m4
index e316f8b..50cb735 100644
--- a/lib/replace/libreplace_cc.m4
+++ b/lib/replace/libreplace_cc.m4
@@ -64,6 +64,7 @@ dnl Add #include for broken IRIX header files
 case "$host_os" in
 	*irix6*) AC_ADD_INCLUDE(<standards.h>)
 		AC_N_DEFINE(_XOPEN_SOURCE,600)
+		AC_N_DEFINE(_BSD_TYPES)
 		;;
 	*hpux*)
 		# mmap on HPUX is completely broken...
diff --git a/lib/replace/wscript b/lib/replace/wscript
index e178cca..3dbbd2a 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -41,6 +41,7 @@ def configure(conf):
     # SCM_RIGHTS is only avail if _XOPEN_SOURCE iѕ defined on IRIX
     if conf.env['SYSTEM_UNAME_SYSNAME'] == 'IRIX':
         conf.DEFINE('_XOPEN_SOURCE', 600, add_to_cflags=True)
+        conf.DEFINE('_BSD_TYPES', 1, add_to_cflags=True)
 
     conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
     conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
diff --git a/source3/configure.in b/source3/configure.in
index 0bae24b..e6a1310 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4586,7 +4586,7 @@ AC_CHECK_HEADERS(sys/quota.h)
 AC_CHECK_HEADERS(ufs/ufs/quota.h)
 
 
-if test x"$samba_cv_found_xfs_header" != x"yes"; then
+if test x"$ac_cv_header_xfs_xqm_h" != x"yes"; then
 # if we have xfs quota support <sys/quota.h> (IRIX) we should use it
 AC_CACHE_CHECK([for XFS QUOTA in <sys/quota.h>],samba_cv_HAVE_SYS_QUOTA_XFS, [
 AC_TRY_COMPILE([
@@ -4672,6 +4672,9 @@ AC_TRY_COMPILE([
 
 if test x"$samba_cv_HAVE_NFS_QUOTAS" = x"yes"; then
     AC_DEFINE(HAVE_NFS_QUOTAS,1,[NFS quota support is available])
+    AC_CHECK_MEMBER(struct getquota_rslt.getquota_rslt_u,
+		AC_DEFINE(HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U, 1, [Defined if struct getquota_rslt has getquota_rslt_u]),,
+		[#include <rpcsvc/rquota.h>])
 fi
 
 #################################################
diff --git a/source3/lib/sysquotas_nfs.c b/source3/lib/sysquotas_nfs.c
index 043ab9f..6f87137 100644
--- a/source3/lib/sysquotas_nfs.c
+++ b/source3/lib/sysquotas_nfs.c
@@ -44,6 +44,14 @@
 #endif
 #include <rpc/xdr.h>
 
+#ifdef HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U
+#define GQR_RQUOTA getquota_rslt_u.gqr_rquota
+#define GQR_STATUS status
+#else
+#define GQR_RQUOTA gqr_rquota
+#define GQR_STATUS gqr_status
+#endif
+
 static int my_xdr_getquota_args(XDR *xdrsp, struct getquota_args *args)
 {
 	if (!xdr_string(xdrsp, &args->gqa_pathp, RQ_PATHLEN ))
@@ -63,23 +71,23 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
 	}
 	gqr->status = quotastat;
 
-	if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bsize)) {
+	if (!xdr_int(xdrsp, &gqr->GQR_RQUOTA.rq_bsize)) {
 		DEBUG(6,("nfs_quotas: Block size bad or zero\n"));
 		return 0;
 	}
-	if (!xdr_bool(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_active)) {
+	if (!xdr_bool(xdrsp, &gqr->GQR_RQUOTA.rq_active)) {
 		DEBUG(6,("nfs_quotas: Active bad or zero\n"));
 		return 0;
 	}
-	if (!xdr_int(xdrsp, (int *)&gqr->getquota_rslt_u.gqr_rquota.rq_bhardlimit)) {
+	if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_bhardlimit)) {
 		DEBUG(6,("nfs_quotas: Hardlimit bad or zero\n"));
 		return 0;
 	}
-	if (!xdr_int(xdrsp, (int *)&gqr->getquota_rslt_u.gqr_rquota.rq_bsoftlimit)) {
+	if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_bsoftlimit)) {
 		DEBUG(6,("nfs_quotas: Softlimit bad or zero\n"));
 		return 0;
 	}
-	if (!xdr_int(xdrsp, (int *)&gqr->getquota_rslt_u.gqr_rquota.rq_curblocks)) {
+	if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_curblocks)) {
 		DEBUG(6,("nfs_quotas: Currentblocks bad or zero\n"));
 		return 0;
 	}
@@ -186,17 +194,17 @@ int sys_get_nfs_quota(const char *path, const char *bdev,
 		   "curfiles     : '%u'\n"
 		   "btimeleft    : '%u'\n"
 		   "ftimeleft    : '%u'\n",
-		   gq_rslt.status,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_active?"yes":"no",
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_fsoftlimit,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_curfiles,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_btimeleft,
-		   gq_rslt.getquota_rslt_u.gqr_rquota.rq_ftimeleft));
+		   gq_rslt.GQR_STATUS,
+		   gq_rslt.GQR_RQUOTA.rq_bsize,
+		   gq_rslt.GQR_RQUOTA.rq_active?"yes":"no",
+		   gq_rslt.GQR_RQUOTA.rq_bhardlimit,
+		   gq_rslt.GQR_RQUOTA.rq_bsoftlimit,
+		   gq_rslt.GQR_RQUOTA.rq_curblocks,
+		   gq_rslt.GQR_RQUOTA.rq_fhardlimit,
+		   gq_rslt.GQR_RQUOTA.rq_fsoftlimit,
+		   gq_rslt.GQR_RQUOTA.rq_curfiles,
+		   gq_rslt.GQR_RQUOTA.rq_btimeleft,
+		   gq_rslt.GQR_RQUOTA.rq_ftimeleft));
 
 	/*
 	 * gqr.status returns
@@ -206,19 +214,19 @@ int sys_get_nfs_quota(const char *path, const char *bdev,
 	 *   3 if no permission to get the quota.
 	 */
 
-	switch (gq_rslt.status) {
+	switch (gq_rslt.GQR_STATUS) {
 	case 0:
 		DEBUG(3, ("sys_get_nfs_quotas: Remote Quotas Failed! "
-			  "Error '%i'\n", gq_rslt.status));
+			  "Error '%i'\n", gq_rslt.GQR_STATUS));
 		ret = -1;
 		goto out;
 
 	case 1:
 		DEBUG(10, ("sys_get_nfs_quotas: Good quota data\n"));
-		dp->bsize = (uint64_t)gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize;
-		dp->softlimit = gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit;
-		dp->hardlimit = gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit;
-		dp->curblocks = gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks;
+		dp->bsize = (uint64_t)gq_rslt.GQR_RQUOTA.rq_bsize;
+		dp->softlimit = gq_rslt.GQR_RQUOTA.rq_bsoftlimit;
+		dp->hardlimit = gq_rslt.GQR_RQUOTA.rq_bhardlimit;
+		dp->curblocks = gq_rslt.GQR_RQUOTA.rq_curblocks;
 		break;
 
 	case 2:
@@ -234,7 +242,7 @@ int sys_get_nfs_quota(const char *path, const char *bdev,
 
 	default:
 		DEBUG(5, ("sys_get_nfs_quotas: Unknown remote quota status "
-			  "code '%i'\n", gq_rslt.status));
+			  "code '%i'\n", gq_rslt.GQR_STATUS));
 		ret = -1;
 		goto out;
 		break;
diff --git a/source3/rpc_server/rpc_server.h b/source3/rpc_server/rpc_server.h
index 5d8ee6a..308354d 100644
--- a/source3/rpc_server/rpc_server.h
+++ b/source3/rpc_server/rpc_server.h
@@ -21,7 +21,6 @@
 #define _RPC_SERVER_H_
 
 struct pipes_struct;
-enum dcerpc_transport_t;
 
 typedef bool (*dcerpc_ncacn_disconnect_fn)(struct pipes_struct *p);
 typedef void (named_pipe_termination_fn)(void *private_data);
diff --git a/source3/tests/sysquotas.c b/source3/tests/sysquotas.c
index e9a699c..68f8a1c 100644
--- a/source3/tests/sysquotas.c
+++ b/source3/tests/sysquotas.c
@@ -51,7 +51,9 @@
 #include <sys/quota.h>
 #else /* *BSD */
 #include <sys/types.h>
+#ifdef HAVE_UFS_UFS_QUOTA_H
 #include <ufs/ufs/quota.h>
+#endif
 #include <machine/param.h>
 #endif
 
diff --git a/source3/wscript b/source3/wscript
old mode 100755
new mode 100644
index a496aaa..61d3b9a
--- a/source3/wscript
+++ b/source3/wscript
@@ -1188,13 +1188,39 @@ main() {
     if Options.options.with_quotas:
         # For quotas on Veritas VxFS filesystems
         conf.CHECK_HEADERS('sys/fs/vx_quota.h')
-        # For quotas on Linux XFS filesystems
-        conf.CHECK_HEADERS('xfs/xqm.h')
         # For sys/quota.h and linux/quota.h
         conf.CHECK_HEADERS('sys/quota.h')
         # For quotas on BSD systems
         conf.CHECK_HEADERS('ufs/ufs/quota.h')
-
+        # For quotas on Linux XFS filesystems
+        if conf.CHECK_HEADERS('xfs/xqm.h'):
+            conf.DEFINE('HAVE_XFS_QUOTAS', '1')
+        else:
+            # For Irix XFS
+            conf.CHECK_CODE('''
+                #include "confdefs.h"
+                #ifdef HAVE_SYS_TYPES_H
+                #include <sys/types.h>
+                #endif
+                #ifdef HAVE_ASM_TYPES_H
+                #include <asm/types.h>
+                #endif
+                #include <sys/quota.h>
+                int i = Q_XGETQUOTA;''',
+                define='HAVE_XFS_QUOTAS',
+                msg='for XFS QUOTA in <sys/quota.h>',
+                execute=False,
+                local_include=False)
+        
+        # For IRIX like dqb_isoftlimit instead of dqb_fsoftlimit in struc dqblk
+        conf.CHECK_STRUCTURE_MEMBER('struct dqblk', 'dqb_fsoftlimit', define='HAVE_DQB_FSOFTLIMIT',
+                                headers='sys/quota.h')
+
+        if conf.CHECK_HEADERS('rpcsvc/rquota.h'):
+            conf.DEFINE('HAVE_NFS_QUOTAS', '1')
+            conf.CHECK_STRUCTURE_MEMBER('struct getquota_rslt', 'getquota_rslt_u',
+                                        define='HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U',
+                                        headers='rpcsvc/rquota.h')
 
     #
     # checking for clustering extensions (CTDB)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list