From: Ben Pfaff Date: Mon, 24 Jan 2011 22:03:57 +0000 (-0800) Subject: datapath: Move rcu_read_lock_held(), rcu_dereference_*() to rcupdate.h. X-Git-Tag: v1.1.0~454 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=77263a25ab4025be9e8ac1ab684ffc459550b16a;p=sliver-openvswitch.git 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 --- diff --git a/datapath/linux-2.6/Modules.mk b/datapath/linux-2.6/Modules.mk index 42514b163..2e779aa48 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 000000000..f96299f4c --- /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 bb9bc379e..59be83f82 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