Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / libcfs / autoconf / lustre-libcfs.m4
index ae74dc0..492b0e7 100644 (file)
@@ -241,6 +241,24 @@ CFLAGS="$tmp_flags"
 ])
 
 
+# check if task_struct with rcu memeber
+AC_DEFUN([LIBCFS_TASK_RCU],
+[AC_MSG_CHECKING([if task_struct has a rcu field])
+LB_LINUX_TRY_COMPILE([
+       #include <linux/sched.h>
+],[
+        struct task_struct tsk;
+
+        tsk.rcu.next = NULL;
+],[
+        AC_MSG_RESULT([yes])
+        AC_DEFINE(HAVE_TASK_RCU, 1,
+                  [task_struct has rcu field])
+],[
+        AC_MSG_RESULT([no])
+])
+])
+
 # LIBCFS_TASKLIST_LOCK
 # 2.6.18 remove tasklist_lock export
 AC_DEFUN([LIBCFS_TASKLIST_LOCK],
@@ -363,6 +381,59 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+# 2.6.24 request not use real numbers for ctl_name
+AC_DEFUN([LN_SYSCTL_UNNUMBERED],
+[AC_MSG_CHECKING([for CTL_UNNUMBERED])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/sysctl.h>
+],[
+       #ifndef CTL_UNNUMBERED
+       #error CTL_UNNUMBERED not exist in kernel
+       #endif
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_SYSCTL_UNNUMBERED, 1,
+                  [sysctl has CTL_UNNUMBERED])
+],[
+        AC_MSG_RESULT(NO)
+])
+])
+
+# 2.6.24 lost scatterlist->page
+AC_DEFUN([LN_SCATTERLIST_SETPAGE],
+[AC_MSG_CHECKING([for exist sg_set_page])
+LB_LINUX_TRY_COMPILE([
+        #include <linux/scatterlist.h>
+],[
+       sg_set_page(NULL,NULL,0,0);
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_SCATTERLIST_SETPAGE, 1,
+                  [struct scatterlist has page member])
+],[
+        AC_MSG_RESULT(NO)
+])
+])
+
+# 2.6.26 use int instead of atomic for sem.count
+AC_DEFUN([LN_SEM_COUNT],
+[AC_MSG_CHECKING([atomic sem.count])
+LB_LINUX_TRY_COMPILE([
+        #include <asm/semaphore.h>
+],[
+       struct semaphore s;
+       
+       atomic_read(&s.count);
+],[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1,
+                  [semaphore counter is atomic])
+],[
+        AC_MSG_RESULT(NO)
+])
+])
+
+
 #
 # LIBCFS_PROG_LINUX
 #
@@ -381,6 +452,7 @@ LIBCFS_FUNC_SHOW_TASK
 LIBCFS_U64_LONG_LONG
 LIBCFS_SSIZE_T_LONG
 LIBCFS_SIZE_T_LONG
+LIBCFS_TASK_RCU
 # 2.6.18
 LIBCFS_TASKLIST_LOCK
 # 2.6.19
@@ -393,6 +465,11 @@ LIBCFS_2ARGS_REGISTER_SYSCTL
 LIBCFS_KMEM_CACHE
 # 2.6.23
 LIBCFS_KMEM_CACHE_CREATE_DTOR
+# 2.6.24
+LN_SYSCTL_UNNUMBERED
+LN_SCATTERLIST_SETPAGE
+# 2.6.26
+LN_SEM_COUNT
 ])
 
 #