From: yangsheng Date: Tue, 10 Jan 2012 18:59:11 +0000 (+0800) Subject: LU-506 kernel: Add config check for sb_any_quota_loaded X-Git-Tag: 2.1.54~3 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c746abe3d0738a9553c5322665dff3be66a66873 LU-506 kernel: Add config check for sb_any_quota_loaded Add config check for sb_any_quota_loaded() since OFED just backport DQUOT_USAGE_ENABLED. Signed-off-by: yangsheng Change-Id: I2f5fe42408bed1be7110944e7a47e0af16d896db Reviewed-on: http://review.whamcloud.com/1943 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Michael MacDonald Reviewed-by: Brian J. Murrell Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 45146fe..3d3497b 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 +],[ + 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], @@ -2366,6 +2382,9 @@ AC_DEFUN([LC_PROG_LINUX], 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 diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index d13ea31..8af616e 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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 -#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)