From 8fa04e97a59178f3ed03056f7a8a318b0cc024c6 Mon Sep 17 00:00:00 2001 From: wangyb Date: Thu, 4 Jun 2009 09:40:38 +0000 Subject: [PATCH] b=18015 a=adilger r=zhenyu.xu, sheng.yang check if synchronize_rcu is available, otherwise use synchronize_kernel --- lustre/autoconf/lustre-core.m4 | 12 ++++++++++++ lustre/include/linux/lustre_compat25.h | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index cbf9877..7af19f5 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -809,6 +809,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], @@ -1631,6 +1642,7 @@ AC_DEFUN([LC_PROG_LINUX], # 2.6.12 LC_RW_TREE_LOCK + 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 277b8ce..611e5be 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -607,6 +607,10 @@ static inline int ll_crypto_hmac(struct crypto_tfm *tfm, #define ll_crypto_tfm_alg_max_keysize crypto_tfm_alg_max_keysize #endif /* HAVE_ASYNC_BLOCK_CIPHER */ +#ifndef HAVE_SYNCHRONIZE_RCU +#define synchronize_rcu() synchronize_kernel() +#endif + #ifdef HAVE_SECURITY_PLUG #define ll_remove_suid(inode,mnt) remove_suid(inode,mnt) #define ll_vfs_rmdir(dir,entry,mnt) vfs_rmdir(dir,entry,mnt) -- 1.8.3.1