Whamcloud - gitweb
b=24037 Changes of 2.6.32 kernel.
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index bb9bf6e..6edf267 100644 (file)
@@ -700,26 +700,6 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
-# LC_D_OBTAIN_ALIAS
-# starting from 2.6.18 kernel don't export do_kern_mount
-# and want to use vfs_kern_mount instead.
-#
-AC_DEFUN([LC_D_OBTAIN_ALIAS],
-[AC_MSG_CHECKING([d_obtain_alias exist in kernel])
-LB_LINUX_TRY_COMPILE([
-        #include <linux/dcache.h>
-],[
-        d_obtain_alias(NULL);
-],[
-        AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
-                [d_obtain_alias exist in kernel])
-        AC_MSG_RESULT([yes])
-],[
-        AC_MSG_RESULT([no])
-])
-])
-
-#
 # LC_INVALIDATEPAGE_RETURN_INT
 # 2.6.17 changes return type for invalidatepage to 'void' from 'int'
 #
@@ -1203,6 +1183,24 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+# 2.6.23 add code to wait other users to complete before removing procfs entry
+AC_DEFUN([LC_PROCFS_USERS],
+[AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/proc_fs.h>
+],[
+        struct proc_dir_entry pde;
+
+        pde.pde_users   = 0;
+],[
+        AC_MSG_RESULT([yes])
+        AC_DEFINE(HAVE_PROCFS_USERS, 1,
+                [kernel has pde_users member in procfs entry struct])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 # 2.6.24 has bio_endio with 2 args
 AC_DEFUN([LC_BIO_ENDIO_2ARG],
 [AC_MSG_CHECKING([if kernel has bio_endio with 2 args])
@@ -1850,6 +1848,26 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+#
+# LC_D_OBTAIN_ALIAS
+# starting from 2.6.28 kernel replaces d_alloc_anon() with
+# d_obtain_alias() for getting anonymous dentries
+#
+AC_DEFUN([LC_D_OBTAIN_ALIAS],
+[AC_MSG_CHECKING([d_obtain_alias exist in kernel])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/dcache.h>
+],[
+        d_obtain_alias(NULL);
+],[
+        AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1,
+                [d_obtain_alias exist in kernel])
+        AC_MSG_RESULT([yes])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 # 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function
 AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE],
 [AC_MSG_CHECKING([if blk_queue_logical_block_size is defined])
@@ -1866,34 +1884,52 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
-# 2.6.32 without DQUOT_INIT defined.
-AC_DEFUN([LC_DQUOT_INIT],
-[AC_MSG_CHECKING([if DQUOT_INIT is defined])
+# 2.6.32 add a limits member in struct request_queue.
+AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
+[AC_MSG_CHECKING([if request_queue has a limits field])
 LB_LINUX_TRY_COMPILE([
-        #include <linux/quotaops.h>
+        #include <linux/blkdev.h>
+],[
+        struct request_queue rq;
+        rq.limits.io_min = 0;
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
+                  [request_queue has a limits field])
+],[
+        AC_MSG_RESULT(no)
+])
+])
+
+# RHEL6(backport from 2.6.34) removes 2 functions blk_queue_max_phys_segments and
+# blk_queue_max_hw_segments add blk_queue_max_segments
+AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS],
+[AC_MSG_CHECKING([if blk_queue_max_segments is defined])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/blkdev.h>
 ],[
-        DQUOT_INIT(NULL);
+        blk_queue_max_segments(NULL, 0);
 ],[
         AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_DQUOT_INIT, 1,
-                  [DQUOT_INIT is defined])
+        AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1,
+                  [blk_queue_max_segments is defined])
 ],[
         AC_MSG_RESULT(no)
 ])
 ])
 
-# 2.6.32 add a limits member in struct request_queue.
-AC_DEFUN([LC_REQUEST_QUEUE_LIMITS],
-[AC_MSG_CHECKING([if request_queue has a limits field])
+# RHEL6(backport from 2.6.34) removes blk_queue_max_sectors and add blk_queue_max_hw_sectors
+# check blk_queue_max_sectors and use it until disappear.
+AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS],
+[AC_MSG_CHECKING([if blk_queue_max_sectors is defined])
 LB_LINUX_TRY_COMPILE([
         #include <linux/blkdev.h>
 ],[
-        struct request_queue rq;
-        rq.limits.io_min = 0;
+        blk_queue_max_sectors(NULL, 0);
 ],[
         AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1,
-                  [request_queue has a limits field])
+        AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1,
+                  [blk_queue_max_sectors is defined])
 ],[
         AC_MSG_RESULT(no)
 ])
@@ -2046,6 +2082,7 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_HAVE_EXPORTFS_H
          LC_VM_OP_FAULT
          LC_REGISTER_SHRINKER
+         LC_PROCFS_USERS
   
         # 2.6.24
         LC_HAVE_MMTYPES_H
@@ -2082,9 +2119,10 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_BLK_QUEUE_LOG_BLK_SIZE
 
          # 2.6.32
-         LC_DQUOT_INIT
          LC_REQUEST_QUEUE_LIMITS
          LC_NEW_BACKING_DEV_INFO
+         LC_BLK_QUEUE_MAX_SECTORS
+         LC_BLK_QUEUE_MAX_SEGMENTS
 
          #
          if test x$enable_server = xyes ; then
@@ -2591,6 +2629,17 @@ if test x$enable_lu_ref = xyes ; then
         AC_DEFINE([USE_LU_REF], 1, [enable lu_ref reference tracking code])
 fi
 
+AC_ARG_ENABLE([pgstate-track],
+              AC_HELP_STRING([--enable-pgstate-track],
+                             [enable page state tracking]),
+              [enable_pgstat_track='yes'],[])
+AC_MSG_CHECKING([whether to enable page state tracking])
+AC_MSG_RESULT([$enable_pgstat_track])
+if test x$enable_pgstat_track = xyes ; then
+        AC_DEFINE([LUSTRE_PAGESTATE_TRACKING], 1,
+                  [enable page state tracking code])
+fi
+
          #2.6.29
          LC_WRITE_BEGIN_END
          LC_D_OBTAIN_ALIAS