Whamcloud - gitweb
branch b1_8
authorwangyb <wangyb>
Tue, 28 Apr 2009 08:15:20 +0000 (08:15 +0000)
committerwangyb <wangyb>
Tue, 28 Apr 2009 08:15:20 +0000 (08:15 +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 d0f2f4e..f046a92 100644 (file)
@@ -758,6 +758,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],
@@ -1615,6 +1626,7 @@ AC_DEFUN([LC_PROG_LINUX],
 
           # 2.6.12
           LC_RW_TREE_LOCK
+          LC_EXPORT_SYNCHRONIZE_RCU
 
           # 2.6.15
           LC_INODE_I_MUTEX
index cba65b4..64c62fe 100644 (file)
@@ -434,6 +434,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)