Whamcloud - gitweb
LU-1782 quota: ignore sb_has_quota_active() in OFED's header
authorShuichi Ihara <sihara@ddn.com>
Thu, 23 Aug 2012 16:36:46 +0000 (01:36 +0900)
committerJohann Lombardi <johann@whamcloud.com>
Mon, 27 Aug 2012 08:02:54 +0000 (04:02 -0400)
sb_has_quota_active() and sb_any_quota_active() are defined
in ofed's backport headers, but if these are reffered on
RHEL5's kernel, quota is broken. So, it ignores them.

Signed-off-by: Shuichi Ihara <sihara@ddn.com>
Change-Id: Ic78799bc5d948b583b4a515479d5091381c63185
Reviewed-on: http://review.whamcloud.com/3764
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/autoconf/lustre-core.m4

index 1a86fce..9385d01 100644 (file)
@@ -1570,33 +1570,43 @@ LB_LINUX_TRY_COMPILE([
 # 2.6.27 sles11 has sb_any_quota_active
 AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE],
 [AC_MSG_CHECKING([Kernel has sb_any_quota_active])
-LB_LINUX_TRY_COMPILE([
-        #include <linux/quotaops.h>
+       # Ignore backported quotaops.h in OFED
+       if test -f $OFED_BACKPORT_PATH/linux/quotaops.h ; then
+               AC_MSG_RESULT(no)
+       else
+               LB_LINUX_TRY_COMPILE([
+                       #include <linux/quotaops.h>
 ],[
-        sb_any_quota_active(NULL);
+                       sb_any_quota_active(NULL);
 ],[
-        AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
-                [Kernel has a sb_any_quota_active])
-        AC_MSG_RESULT([yes])
+                       AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1,
+                               [Kernel has a sb_any_quota_active])
+                       AC_MSG_RESULT([yes])
 ],[
-        AC_MSG_RESULT([no])
+                       AC_MSG_RESULT([no])
 ])
+       fi
 ])
 
 # 2.6.27 sles11 has sb_has_quota_active
 AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE],
 [AC_MSG_CHECKING([Kernel has sb_has_quota_active])
-LB_LINUX_TRY_COMPILE([
-        #include <linux/quotaops.h>
+       # Ignore backported quotaops.h in OFED
+       if test -f $OFED_BACKPORT_PATH/linux/quotaops.h ; then
+               AC_MSG_RESULT(no)
+       else
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/quotaops.h>
 ],[
-        sb_has_quota_active(NULL, 0);
+               sb_has_quota_active(NULL, 0);
 ],[
-        AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
-                [Kernel has a sb_has_quota_active])
-        AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1,
+                       [Kernel has a sb_has_quota_active])
+               AC_MSG_RESULT([yes])
 ],[
-        AC_MSG_RESULT([no])
+               AC_MSG_RESULT([no])
 ])
+       fi
 ])
 
 # 2.6.27 has inode_permission instead of permisson