Whamcloud - gitweb
branch b1_6
authorwangyb <wangyb>
Tue, 28 Apr 2009 08:13:56 +0000 (08:13 +0000)
committerwangyb <wangyb>
Tue, 28 Apr 2009 08:13:56 +0000 (08:13 +0000)
b=18015
i=zhenyu.xu
i=sheng.yang

check if synchronize_rcu is available, otherwise use synchronize_kernel

lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h

index bbe3bdf..9572896 100644 (file)
@@ -713,6 +713,17 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+# LC_EXPORT_SYNCHRONIZE_RCU
+# after 2.6.12 synchronize_rcu is preferred over synchronize_kernel
+AC_DEFUN([LC_EXPORT_SYNCHRONIZE_RCU],
+[LB_CHECK_SYMBOL_EXPORT([synchronize_rcu],
+[kernel/rcupdate.c],[
+        AC_DEFINE(HAVE_SYNCHRONIZE_RCU, 1,
+                [in 2.6.12 synchronize_rcu preferred over synchronize_kernel])
+],[
+])
+])
+
 # LC_INODE_I_MUTEX
 # after 2.6.15 inode have i_mutex intead of i_sem
 AC_DEFUN([LC_INODE_I_MUTEX],
@@ -1523,6 +1534,9 @@ AC_DEFUN([LC_PROG_LINUX],
           # does the kernel have VFS intent patches?
           LC_VFS_INTENT_PATCHES
 
+          # 2.6.12
+          LC_EXPORT_SYNCHRONIZE_RCU
+
           # 2.6.15
           LC_INODE_I_MUTEX
 
index def34ee..09d4c71 100644 (file)
@@ -398,6 +398,10 @@ int ll_unregister_blkdev(unsigned int dev, const char *name)
  #endif
 #endif
 
+#ifndef HAVE_SYNCHRONIZE_RCU
+#define synchronize_rcu() synchronize_kernel()
+#endif
+
 #ifdef HAVE_SECURITY_PLUG
 #define ll_vfs_rmdir(dir,entry,mnt)             vfs_rmdir(dir,entry,mnt)
 #define ll_vfs_mkdir(inode,dir,mnt,mode)        vfs_mkdir(inode,dir,mnt,mode)