[SCM] Samba Shared Repository - branch master updated
Björn Jacke
bjacke at samba.org
Fri Sep 7 08:00:02 MDT 2012
The branch, master has been updated
via ee2d6ae s3:quota: clean up and consolidate the xfs quota checks and defines
via 3810ee4 s3:sysquota_xfs: fix logic so that we actually use this module on Linux
via d1623ec s3:sysquota_xfs: check and include the right fs header file for xfs quotas
via 1f61abd s3-smbd: Remove OSF1 support from old (pre-sysquotas) code
via 8299bd1 waf: add check for BSD_STYLE_STATVFS
from b317f75 s3-smbldap: make smbldap public library and maintain its ABI
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit ee2d6ae1480496c89f483cc3613f025a9342b6ab
Author: Björn Jacke <bj at sernet.de>
Date: Fri Sep 7 13:13:49 2012 +0200
s3:quota: clean up and consolidate the xfs quota checks and defines
Autobuild-User(master): Björn Jacke <bj at sernet.de>
Autobuild-Date(master): Fri Sep 7 15:59:46 CEST 2012 on sn-devel-104
commit 3810ee4e87eda67583f4458435b28112ee711300
Author: Björn Jacke <bj at sernet.de>
Date: Thu Sep 6 17:00:54 2012 +0200
s3:sysquota_xfs: fix logic so that we actually use this module on Linux
commit d1623ec025efa74f31db1177727c8cc0d34d03b6
Author: Björn Jacke <bj at sernet.de>
Date: Thu Sep 6 17:26:55 2012 +0200
s3:sysquota_xfs: check and include the right fs header file for xfs quotas
commit 1f61abd322b5d93ab4d3655ca8efff3545474f1f
Author: Björn Jacke <bj at sernet.de>
Date: Thu Sep 6 16:35:20 2012 +0200
s3-smbd: Remove OSF1 support from old (pre-sysquotas) code
"recent" Tru64 releases had QUOTACTL_4B support
commit 8299bd1814ae4d3b79ee649e70a9336271ccfa7a
Author: Björn Jacke <bj at sernet.de>
Date: Thu Sep 6 16:15:04 2012 +0200
waf: add check for BSD_STYLE_STATVFS
a leftover from bug #8777
-----------------------------------------------------------------------
Summary of changes:
lib/util/wscript_configure | 12 ++++++++
source3/configure.in | 12 +++----
source3/lib/sysquotas.c | 2 +-
source3/lib/sysquotas_xfs.c | 21 ++++++--------
source3/smbd/quotas.c | 65 -------------------------------------------
source3/wscript | 2 +-
6 files changed, 28 insertions(+), 86 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure
index f0514fd..3cb2ffc 100644
--- a/lib/util/wscript_configure
+++ b/lib/util/wscript_configure
@@ -58,6 +58,18 @@ if not found_statfs:
print("FATAL: Failed to find a statfs method")
raise
+if conf.CONFIG_SET('STAT_STATFS2_BSIZE'):
+ conf.CHECK_CODE("""#ifdef HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+ #ifdef HAVE_SYS_MOUNT_H
+ #include <sys/mount.h>
+ #endif
+ struct statfs fsd; fsd.f_iosize = 0;""",
+ define='BSD_STYLE_STATVFS',
+ msg='Checking for *bsd style statfs with statfs.f_iosize',
+ execute=False,
+ local_include=False)
conf.CHECK_CODE('struct statvfs buf; buf.f_fsid = 0',
define='HAVE_FSID_INT',
diff --git a/source3/configure.in b/source3/configure.in
index c144e6f..0bae24b 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4554,7 +4554,6 @@ case "$host_os" in
AC_MSG_CHECKING(whether to use the lib/sysquotas_linux.c builtin support)
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LINUX_XFS_QUOTAS,1,[Whether Linux xfs quota support is available])
AC_MSG_CHECKING(whether to use the lib/sysquotas_xfs.c builtin support)
AC_MSG_RESULT(yes)
;;
@@ -4575,8 +4574,10 @@ AC_CHECK_HEADER(asm/types.h,[
# For quotas on Veritas VxFS filesystems
AC_CHECK_HEADERS(sys/fs/vx_quota.h)
-# For quotas on Linux XFS filesystems
-AC_CHECK_HEADERS(linux/dqblk_xfs.h)
+# For quotas on XFS filesystems, Linux style
+AC_CHECK_HEADERS(xfs/xqm.h,[
+ AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available])
+ ])
# For sys/quota.h and linux/quota.h
AC_CHECK_HEADERS(sys/quota.h)
@@ -4600,7 +4601,7 @@ AC_TRY_COMPILE([
],[int i = Q_XGETQUOTA;],
samba_cv_HAVE_SYS_QUOTA_XFS=yes,samba_cv_HAVE_SYS_QUOTA_XFS=no)])
if test "$samba_cv_HAVE_SYS_QUOTA_XFS"x = "yes"x; then
- samba_cv_found_xfs_header=yes
+ AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available])
fi
fi
@@ -4692,9 +4693,6 @@ if test x"$samba_cv_SYSQUOTA_FOUND" = x"yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
AC_DEFINE(HAVE_SYS_QUOTAS,1,[Whether the new lib/sysquotas.c interface can be used])
- if test x"$samba_cv_found_xfs_header" = x"yes"; then
- AC_DEFINE(HAVE_XFS_QUOTAS,1,[Whether xfs quota support is available])
- fi
else
AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether to use the old quota support)
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index cbacc7b..76f66a7 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -172,7 +172,7 @@ static struct {
int (*get_quota)(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
int (*set_quota)(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp);
} sys_quota_backends[] = {
-#ifdef HAVE_XFS_QUOTAS
+#if defined HAVE_XFS_QUOTAS
{"xfs", sys_get_xfs_quota, sys_set_xfs_quota},
#endif /* HAVE_XFS_QUOTAS */
#ifdef HAVE_NFS_QUOTAS
diff --git a/source3/lib/sysquotas_xfs.c b/source3/lib/sysquotas_xfs.c
index 1e438e9..cf77eac 100644
--- a/source3/lib/sysquotas_xfs.c
+++ b/source3/lib/sysquotas_xfs.c
@@ -23,23 +23,20 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_QUOTA
-#ifndef HAVE_SYS_QUOTAS
-#ifdef HAVE_XFS_QUOTAS
-#undef HAVE_XFS_QUOTAS
-#endif
+#if defined(HAVE_SYS_QUOTAS) && defined(HAVE_XFS_QUOTAS)
+
+#ifdef HAVE_SYS_QUOTA_H
+#include <sys/quota.h>
#endif
-#ifdef HAVE_XFS_QUOTAS
+/* this one should actually come from glibc: */
+/* #include "samba_linux_quota.h" */
-#ifdef HAVE_LINUX_XFS_QUOTAS
-#include "samba_linux_quota.h"
-#ifdef HAVE_LINUX_DQBLK_XFS_H
-#include <linux/dqblk_xfs.h>
+#ifdef HAVE_XFS_XQM_H
+#include <xfs/xqm.h>
#endif
+
#define HAVE_GROUP_QUOTA
-#else /* IRIX */
-#include <sys/quota.h>
-#endif
/* on IRIX */
#ifndef Q_XQUOTAON
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 3d1056d..d9b21f5 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -399,71 +399,6 @@ bool disk_quotas(const char *path,
}
-#elif defined(OSF1)
-#include <ufs/quota.h>
-
-/****************************************************************************
-try to get the disk space from disk quotas - OSF1 version
-****************************************************************************/
-
-bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
-{
- int r, save_errno;
- struct dqblk D;
- SMB_STRUCT_STAT S;
- uid_t euser_id;
-
- /*
- * This code presumes that OSF1 will only
- * give out quota info when the real uid
- * matches the effective uid. JRA.
- */
- euser_id = geteuid();
- save_re_uid();
- if (set_re_uid() != 0) return False;
-
- r= quotactl(path,QCMD(Q_GETQUOTA, USRQUOTA),euser_id,(char *) &D);
- if (r) {
- save_errno = errno;
- }
-
- restore_re_uid();
-
- *bsize = DEV_BSIZE;
-
- if (r)
- {
- if (save_errno == EDQUOT) /* disk quota exceeded */
- {
- *dfree = 0;
- *dsize = D.dqb_curblocks;
- return (True);
- }
- else
- return (False);
- }
-
- /* If softlimit is zero, set it equal to hardlimit.
- */
-
- if (D.dqb_bsoftlimit==0)
- D.dqb_bsoftlimit = D.dqb_bhardlimit;
-
- /* Use softlimit to determine disk space, except when it has been exceeded */
-
- if (D.dqb_bsoftlimit==0)
- return(False);
-
- if ((D.dqb_curblocks>D.dqb_bsoftlimit)) {
- *dfree = 0;
- *dsize = D.dqb_curblocks;
- } else {
- *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
- *dsize = D.dqb_bsoftlimit;
- }
- return (True);
-}
-
#else
#if AIX
diff --git a/source3/wscript b/source3/wscript
index 39a9b92..a496aaa 100755
--- a/source3/wscript
+++ b/source3/wscript
@@ -1189,7 +1189,7 @@ main() {
# For quotas on Veritas VxFS filesystems
conf.CHECK_HEADERS('sys/fs/vx_quota.h')
# For quotas on Linux XFS filesystems
- conf.CHECK_HEADERS('linux/dqblk_xfs.h')
+ 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
--
Samba Shared Repository
More information about the samba-cvs
mailing list