Whamcloud - gitweb
LU-6215 libcfs: shrinker code needs atomic.h
[fs/lustre-release.git] / libcfs / autoconf / lustre-libcfs.m4
index 8b088ba..a3b6142 100644 (file)
@@ -121,25 +121,6 @@ ctl_table_ctl_name, [
 ]) # LIBCFS_SYSCTL_CTLNAME
 
 #
-# LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
-#
-# 2.6.34 adds __add_wait_queue_exclusive
-#
-AC_DEFUN([LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE], [
-LB_CHECK_COMPILE([if '__add_wait_queue_exclusive' exists],
-__add_wait_queue_exclusive, [
-       #include <linux/wait.h>
-],[
-       wait_queue_head_t queue;
-       wait_queue_t      wait;
-       __add_wait_queue_exclusive(&queue, &wait);
-],[
-       AC_DEFINE(HAVE___ADD_WAIT_QUEUE_EXCLUSIVE, 1,
-               [__add_wait_queue_exclusive exists])
-])
-]) # LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
-
-#
 # LC_SK_SLEEP
 #
 # 2.6.35 kernel has sk_sleep function
@@ -157,6 +138,24 @@ sk_sleep, [
 ]) # LC_SK_SLEEP
 
 #
+# LIBCFS_KSTRTOUL
+#
+# 2.6.38 kstrtoul is added
+#
+AC_DEFUN([LIBCFS_KSTRTOUL], [
+LB_CHECK_COMPILE([if Linux kernel has 'kstrtoul'],
+kstrtoul, [
+       #include <linux/kernel.h>
+],[
+       unsigned long result;
+       return kstrtoul("12345", 0, &result);
+],[
+       AC_DEFINE(HAVE_KSTRTOUL, 1,
+               [kernel has kstrtoul])
+])
+]) # LIBCFS_KSTRTOUL
+
+#
 # LIBCFS_DUMP_TRACE_ADDRESS
 #
 # 2.6.39 adds a base pointer address argument to dump_trace
@@ -184,6 +183,7 @@ dump_trace_address, [
 AC_DEFUN([LC_SHRINK_CONTROL], [
 LB_CHECK_COMPILE([if 'shrink_control' is present],
 shrink_control, [
+       #include <linux/atomic.h>
        #include <linux/mm.h>
 ],[
        struct shrink_control tmp = {0};
@@ -296,7 +296,7 @@ shrinker_count_objects, [
        ((struct shrinker*)0)->count_objects(NULL, NULL);
 ],[
        AC_DEFINE(HAVE_SHRINKER_COUNT, 1,
-               [shrinker has count_objects memeber])
+               [shrinker has count_objects member])
 ])
 ])
 
@@ -315,10 +315,10 @@ LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
 LC_SHRINKER_WANT_SHRINK_PTR
 # 2.6.33
 LIBCFS_SYSCTL_CTLNAME
-# 2.6.34
-LIBCFS_ADD_WAIT_QUEUE_EXCLUSIVE
 # 2.6.35
 LC_SK_SLEEP
+# 2.6.38
+LIBCFS_KSTRTOUL
 # 2.6.39
 LIBCFS_DUMP_TRACE_ADDRESS
 # 2.6.40 fc15
@@ -437,14 +437,12 @@ AM_CONDITIONAL(NEED_PCLMULQDQ_CRC32C, [test "x$enable_crc32c_crypto" = xyes])
 #
 AC_DEFUN([LIBCFS_CONFIG_FILES], [
 AC_CONFIG_FILES([
-libcfs/Kernelenv
 libcfs/Makefile
 libcfs/autoMakefile
 libcfs/autoconf/Makefile
 libcfs/include/Makefile
 libcfs/include/libcfs/Makefile
 libcfs/include/libcfs/linux/Makefile
-libcfs/include/libcfs/posix/Makefile
 libcfs/include/libcfs/util/Makefile
 libcfs/libcfs/Makefile
 libcfs/libcfs/autoMakefile