From feebe14900581be1a43883a303c8aef0850d0476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 6 Sep 2012 17:26:55 +0200 Subject: [PATCH 1/2] s3:sysquota_xfs: check and include the right fs header file for xfs quotas also move the tests at the end of all quota tests to make the lib/sysquota.c compile tests not fail. There is no nice way to fix this in 3.6 without a major cleanup like it was done in master. --- source3/configure.in | 11 ++++++----- source3/lib/sysquotas_xfs.c | 5 +++-- source3/wscript | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index eef3d13..bce23f3 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -4936,8 +4936,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]) - samba_cv_found_xfs_header=yes AC_MSG_CHECKING(whether to use the lib/sysquotas_xfs.c builtin support) AC_MSG_RESULT(yes) ;; @@ -4958,9 +4956,6 @@ 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 sys/quota.h and linux/quota.h AC_CHECK_HEADERS(sys/quota.h) @@ -5146,6 +5141,12 @@ if test x"$samba_cv_SYSQUOTA_WORKS_XFS" = x"yes"; then fi fi +# For quotas on XFS filesystems, Linux style +AC_CHECK_HEADERS(xfs/xqm.h,[ + AC_DEFINE(HAVE_LINUX_XFS_QUOTAS,1,[Whether Linux xfs quota support is available]) + ]) + + AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[ SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}" diff --git a/source3/lib/sysquotas_xfs.c b/source3/lib/sysquotas_xfs.c index 1e438e9..7da40ef 100644 --- a/source3/lib/sysquotas_xfs.c +++ b/source3/lib/sysquotas_xfs.c @@ -33,9 +33,10 @@ #ifdef HAVE_LINUX_XFS_QUOTAS #include "samba_linux_quota.h" -#ifdef HAVE_LINUX_DQBLK_XFS_H -#include +#ifdef HAVE_XFS_XQM_H +#include #endif + #define HAVE_GROUP_QUOTA #else /* IRIX */ #include diff --git a/source3/wscript b/source3/wscript index 1ea3559..a07f082 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1510,7 +1510,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') -- 1.7.11.5 From 109f16b19b2bda653d2d8bccb59dcf7773b097c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 6 Sep 2012 17:00:54 +0200 Subject: [PATCH 2/2] s3:sysquota_xfs: fix logic so that we actually use this module on Linux --- source3/lib/sysquotas.c | 2 +- source3/lib/sysquotas_xfs.c | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c index 12c34ed..4e3c5f8 100644 --- a/source3/lib/sysquotas.c +++ b/source3/lib/sysquotas.c @@ -174,7 +174,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 || defined HAVE_LINUX_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 7da40ef..c0df85d 100644 --- a/source3/lib/sysquotas_xfs.c +++ b/source3/lib/sysquotas_xfs.c @@ -23,13 +23,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_QUOTA -#ifndef HAVE_SYS_QUOTAS -#ifdef HAVE_XFS_QUOTAS -#undef HAVE_XFS_QUOTAS -#endif -#endif - -#ifdef HAVE_XFS_QUOTAS +#if defined(HAVE_SYS_QUOTAS) && (defined(HAVE_XFS_QUOTAS) || defined(HAVE_LINUX_XFS_QUOTAS)) #ifdef HAVE_LINUX_XFS_QUOTAS #include "samba_linux_quota.h" -- 1.7.11.5