Whamcloud - gitweb
LU-2642 quota: update quota APIs
authorJames Simmons <uja.ornl@gmail.com>
Wed, 30 Jan 2013 14:31:01 +0000 (09:31 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 9 Feb 2013 07:20:33 +0000 (02:20 -0500)
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 <uja.ornl@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: I61e5a4d6c4a519457146b4a65ce78bfddebe2899
Reviewed-on: http://review.whamcloud.com/5119
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h

index afc03fa..c3ee6c0 100644 (file)
@@ -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 <linux/quotaops.h>
+],[
+       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
index ef54875..b37e3cd 100644 (file)
@@ -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