Whamcloud - gitweb
LU-140 Remove leftovers of iopen
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index f4e0e1f..a5dd773 100644 (file)
@@ -314,24 +314,6 @@ AC_DEFINE(HAVE___D_REHASH, 1,
 ])
 ])
 
-AC_DEFUN([LC_EXPORT_D_MOVE_LOCKED],
-[LB_CHECK_SYMBOL_EXPORT([d_move_locked],
-[fs/dcache.c],[
-AC_DEFINE(HAVE_D_MOVE_LOCKED, 1,
-            [d_move_locked is exported by the kernel])
-],[
-])
-])
-
-AC_DEFUN([LC_EXPORT___D_MOVE],
-[LB_CHECK_SYMBOL_EXPORT([__d_move],
-[fs/dcache.c],[
-AC_DEFINE(HAVE___D_MOVE, 1,
-            [__d_move is exported by the kernel])
-],[
-])
-])
-
 # The actual symbol exported varies among architectures, so we need
 # to check many symbols (but only in the current architecture.)  No
 # matter what symbol is exported, the kernel #defines node_to_cpumask
@@ -1598,7 +1580,29 @@ AC_DEFUN([LC_REGISTER_SHRINKER],
 [mm/vmscan.c],[
         AC_DEFINE(HAVE_REGISTER_SHRINKER, 1,
                   [kernel exports register_shrinker])
+# 2.6.32 added another argument to struct shrinker->shrink
+        AC_MSG_CHECKING([if passing shrinker as first argument])
+        tmp_flags="$EXTRA_KCFLAGS"
+        EXTRA_KCFLAGS="-Werror"
+        LB_LINUX_TRY_COMPILE([
+                #include <linux/mm.h>
+                int test_shrink(struct shrinker *, int, gfp_t);
+        ],[
+                struct shrinker *shr = NULL;
+                shr->shrink = test_shrink;
+        ],[
+                AC_MSG_RESULT([yes])
+                AC_DEFINE(SHRINKER_FIRST_ARG, [struct shrinker *shrinker,],
+                        [kernel is passing shrinker as first argument])
+        ],[
+                AC_DEFINE(SHRINKER_FIRST_ARG, ,
+                        [kernel is not passing shrinker as first argument])
+        ])
+        EXTRA_KCFLAGS="$tmp_flags"
 ],[
+       AC_DEFINE(SHRINKER_FIRST_ARG, ,
+                  [kernel does not exports register_shrinker,
+                  so SHRINKER_FIRST_ARG is empty])
 ])
 ])
 
@@ -2083,23 +2087,6 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
-# 2.6.32-71 adds an argument to shrink callback
-AC_DEFUN([LC_SHRINK_3ARGS],
-[AC_MSG_CHECKING([if shrink has 3 arguments])
-LB_LINUX_TRY_COMPILE([
-        #include <linux/mm.h>
-],[
-        struct shrinker s;
-        return s.shrink(NULL, 0, 0);
-],[
-        AC_MSG_RESULT(yes)
-        AC_DEFINE(HAVE_SHRINK_3ARGS, 1,
-                  [shrink has 3 arguments])
-],[
-        AC_MSG_RESULT(no)
-])
-])
-
 #
 # LC_EXT4_SINGLEDATA_TRANS_BLOCKS_SB
 #
@@ -2211,8 +2198,6 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_EXPORT_TRUNCATE_RANGE
          LC_EXPORT_D_REHASH_COND
          LC_EXPORT___D_REHASH
-         LC_EXPORT_D_MOVE_LOCKED
-         LC_EXPORT___D_MOVE
          LC_EXPORT_NODE_TO_CPUMASK
 
          LC_HEADER_LDISKFS_XATTR
@@ -2346,7 +2331,6 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_SB_BDI
          LC_BLK_QUEUE_MAX_SECTORS
          LC_BLK_QUEUE_MAX_SEGMENTS
-         LC_SHRINK_3ARGS
          LC_EXT4_SINGLEDATA_TRANS_BLOCKS_SB
 
          #