Whamcloud - gitweb
LU-506 kernel: Add config check for sb_any_quota_loaded
authoryangsheng <ys@whamcloud.com>
Tue, 10 Jan 2012 18:59:11 +0000 (02:59 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 11 Jan 2012 15:24:14 +0000 (10:24 -0500)
Add config check for sb_any_quota_loaded() since
OFED just backport DQUOT_USAGE_ENABLED.

Signed-off-by: yangsheng <ys@whamcloud.com>
Change-Id: I2f5fe42408bed1be7110944e7a47e0af16d896db
Reviewed-on: http://review.whamcloud.com/1943
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Michael MacDonald <mjmac@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h

index 45146fe..3d3497b 100644 (file)
@@ -1879,7 +1879,23 @@ AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU],
 ])
 ])
 
 ])
 ])
 
-# 2.6.31
+#
+# 2.6.29 introduce sb_any_quota_loaded.
+#
+AC_DEFUN([LC_SB_ANY_QUOTA_LOADED],
+[AC_MSG_CHECKING([Kernel has sb_any_quota_loaded])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/quotaops.h>
+],[
+        sb_any_quota_loaded(NULL);
+],[
+        AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1,
+                [Kernel has a sb_any_quota_loaded])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
 
 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
 
 # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node
 AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE],
@@ -2366,6 +2382,9 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_SB_HAS_QUOTA_ACTIVE
          LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
 
          LC_SB_HAS_QUOTA_ACTIVE
          LC_EXPORT_ADD_TO_PAGE_CACHE_LRU
 
+         # 2.6.29
+         LC_SB_ANY_QUOTA_LOADED
+
          # 2.6.30
          LC_EXPORT_CPUMASK_OF_NODE
 
          # 2.6.30
          LC_EXPORT_CPUMASK_OF_NODE
 
index d13ea31..8af616e 100644 (file)
@@ -783,7 +783,7 @@ static inline long labs(long x)
 #define ll_sb_has_quota_active(sb, type) sb_has_quota_enabled(sb, type)
 #endif
 
 #define ll_sb_has_quota_active(sb, type) sb_has_quota_enabled(sb, type)
 #endif
 
-#ifdef DQUOT_USAGE_ENABLED
+#ifdef HAVE_SB_ANY_QUOTA_LOADED
 #define ll_sb_any_quota_active(sb) sb_any_quota_loaded(sb)
 #elif defined(HAVE_SB_ANY_QUOTA_ACTIVE)
 #define ll_sb_any_quota_active(sb) sb_any_quota_active(sb)
 #define ll_sb_any_quota_active(sb) sb_any_quota_loaded(sb)
 #elif defined(HAVE_SB_ANY_QUOTA_ACTIVE)
 #define ll_sb_any_quota_active(sb) sb_any_quota_active(sb)