From d76c515e5c77b475972e83a83a4031675cc2814a Mon Sep 17 00:00:00 2001 From: wangyb Date: Tue, 28 Apr 2009 08:13:56 +0000 Subject: [PATCH] branch b1_6 b=18015 i=zhenyu.xu i=sheng.yang check if synchronize_rcu is available, otherwise use synchronize_kernel --- lustre/autoconf/lustre-core.m4 | 14 ++++++++++++++ lustre/include/linux/lustre_compat25.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index bbe3bdf..9572896 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index def34ee..09d4c71 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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) -- 1.8.3.1