From 9ef4b013adfe23405da72d5860b8403b6936f3ca 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 --- source3/configure.in | 8 ++++---- source3/lib/sysquotas_xfs.c | 5 +++-- source3/wscript | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index eef3d13..cdac505 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,8 +4956,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_LINUX_XFS_QUOTAS,1,[Whether Linux xfs quota support is available]) + ]) # For sys/quota.h and linux/quota.h AC_CHECK_HEADERS(sys/quota.h) 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 84cd2a8c3ec6d4d77485ed75b16acafee946e309 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