From 86097b23c959c50a81f7b60ce969bcfece8839aa Mon Sep 17 00:00:00 2001 From: James Simmons Date: Wed, 30 Jan 2013 09:31:01 -0500 Subject: [PATCH] LU-2642 quota: update quota APIs Commit 871a2931 renamed vfs_dq_init to dquot_initialize. (v2.6.34) Commit 9f754758 renamed vfs_dq_drop to dquot_drop. (v2.6.34) Commit b43fa828 renamed vfs_dq_transfer to dquot_transfer. (v2.6.34) Commit 0f0dd62f killed vfs_dq_off and vfs_dq_quota_on_remount and replaced them with dquot_suspend and dquot_resume. (v2.6.34) Signed-off-by: James Simmons Signed-off-by: Jeff Mahoney Change-Id: I61e5a4d6c4a519457146b4a65ce78bfddebe2899 Reviewed-on: http://review.whamcloud.com/5119 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Johann Lombardi --- lustre/autoconf/lustre-core.m4 | 16 ++++++++++++++++ lustre/include/linux/lustre_compat25.h | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index afc03fa..c3ee6c0 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1135,6 +1135,21 @@ LB_LINUX_TRY_COMPILE([ EXTRA_KCFLAGS="$tmp_flags" ]) +# 2.6.34 has renamed dquot options to dquot_*, check for dquot_suspend +AC_DEFUN([LC_HAVE_DQUOT_SUSPEND], +[AC_MSG_CHECKING([if dquot_suspend is defined]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + dquot_suspend(NULL, -1); +],[ + AC_DEFINE(HAVE_DQUOT_SUSPEND, 1, [dquot_suspend is defined]) + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) +]) +]) + # LC_LOCK_MAP_ACQUIRE # after 2.6.27 lock_map_acquire replaces lock_acquire AC_DEFUN([LC_LOCK_MAP_ACQUIRE], @@ -2301,6 +2316,7 @@ AC_DEFUN([LC_PROG_LINUX], # 2.6.34 LC_HAVE_DQUOT_FS_DISK_QUOTA + LC_HAVE_DQUOT_SUSPEND # 2.6.35, 3.0.0 LC_FILE_FSYNC diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index ef54875..b37e3cd 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -538,6 +538,7 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) #define blk_queue_logical_block_size(q, sz) blk_queue_hardsect_size(q, sz) #endif +#ifndef HAVE_DQUOT_SUSPEND #ifndef HAVE_VFS_DQ_OFF # define ll_vfs_dq_init DQUOT_INIT # define ll_vfs_dq_drop DQUOT_DROP @@ -549,6 +550,12 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) # define ll_vfs_dq_transfer vfs_dq_transfer # define ll_vfs_dq_off(sb, remount) vfs_dq_off(sb, remount) #endif +#else +# define ll_vfs_dq_init dquot_initialize +# define ll_vfs_dq_drop dquot_drop +# define ll_vfs_dq_transfer dquot_transfer +# define ll_vfs_dq_off(sb, remount) dquot_suspend(sb, -1) +#endif #ifndef HAVE_BDI_INIT #define bdi_init(bdi) 0 -- 1.8.3.1