From cf6cb3a2ab31a16b01e18e1db2d601e92f2a405e Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Mon, 7 Feb 2011 17:22:58 -0800 Subject: [PATCH] datapath: Check for backported rcu_read_lock_held. New versions of Xen backport this function. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- acinclude.m4 | 4 ++++ datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index fed950bd4..6a829d596 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -168,6 +168,10 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro]) OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_stats]) + OVS_GREP_IFELSE([$KSRC26/include/linux/rcupdate.h], [rcu_read_lock_held], [], + [OVS_GREP_IFELSE([$KSRC26/include/linux/rtnetlink.h], + [rcu_read_lock_held])]) + # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the # member but retain the kerneldoc comment that describes it (which diff --git a/datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h b/datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h index f96299f4c..99459ea71 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h @@ -11,7 +11,7 @@ #define rcu_dereference_protected(p, c) (p) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +#ifndef HAVE_RCU_READ_LOCK_HELD static inline int rcu_read_lock_held(void) { return 1; -- 2.43.0