From 77263a25ab4025be9e8ac1ab684ffc459550b16a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 24 Jan 2011 14:03:57 -0800 Subject: [PATCH] datapath: Move rcu_read_lock_held(), rcu_dereference_*() to rcupdate.h. is the normal location of these functions, so we should not put compat code for them in . This caused build failures for datapath/table.c, which in later commits uses rcu_dereference_check() and rcu_dereference_protected() but does not need RTNL. Signed-off-by: Ben Pfaff Acked-by: Jesse Gross --- datapath/linux-2.6/Modules.mk | 1 + .../compat-2.6/include/linux/rcupdate.h | 21 +++++++++++++++++++ .../compat-2.6/include/linux/rtnetlink.h | 13 ------------ 3 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h diff --git a/datapath/linux-2.6/Modules.mk b/datapath/linux-2.6/Modules.mk index 42514b16..2e779aa4 100644 --- a/datapath/linux-2.6/Modules.mk +++ b/datapath/linux-2.6/Modules.mk @@ -35,6 +35,7 @@ openvswitch_headers += \ linux-2.6/compat-2.6/include/linux/netfilter_ipv4.h \ linux-2.6/compat-2.6/include/linux/netlink.h \ linux-2.6/compat-2.6/include/linux/rculist.h \ + linux-2.6/compat-2.6/include/linux/rcupdate.h \ linux-2.6/compat-2.6/include/linux/rtnetlink.h \ linux-2.6/compat-2.6/include/linux/skbuff.h \ linux-2.6/compat-2.6/include/linux/slab.h \ 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 new file mode 100644 index 00000000..f96299f4 --- /dev/null +++ b/datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h @@ -0,0 +1,21 @@ +#ifndef __RCUPDATE_WRAPPER_H +#define __RCUPDATE_WRAPPER_H 1 + +#include_next + +#ifndef rcu_dereference_check +#define rcu_dereference_check(p, c) rcu_dereference(p) +#endif + +#ifndef rcu_dereference_protected +#define rcu_dereference_protected(p, c) (p) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +static inline int rcu_read_lock_held(void) +{ + return 1; +} +#endif + +#endif /* linux/rcupdate.h wrapper */ diff --git a/datapath/linux-2.6/compat-2.6/include/linux/rtnetlink.h b/datapath/linux-2.6/compat-2.6/include/linux/rtnetlink.h index bb9bc379..59be83f8 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/rtnetlink.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/rtnetlink.h @@ -53,19 +53,6 @@ static inline int lockdep_rtnl_is_held(void) return 1; } #endif - -static inline int rcu_read_lock_held(void) -{ - return 1; -} -#endif - -#ifndef rcu_dereference_check -#define rcu_dereference_check(p, c) rcu_dereference(p) -#endif - -#ifndef rcu_dereference_protected -#define rcu_dereference_protected(p, c) (p) #endif #ifndef rcu_dereference_rtnl -- 2.30.2