datapath: Move rcu_read_lock_held(), rcu_dereference_*() to rcupdate.h.
authorBen Pfaff <blp@nicira.com>
Mon, 24 Jan 2011 22:03:57 +0000 (14:03 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 25 Jan 2011 00:49:21 +0000 (16:49 -0800)
<linux/rcupdate.h> is the normal location of these functions, so we should
not put compat code for them in <linux/rtnetlink.h>.

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 <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/linux-2.6/Modules.mk
datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h [new file with mode: 0644]
datapath/linux-2.6/compat-2.6/include/linux/rtnetlink.h

index 42514b1..2e779aa 100644 (file)
@@ -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 (file)
index 0000000..f96299f
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __RCUPDATE_WRAPPER_H
+#define __RCUPDATE_WRAPPER_H 1
+
+#include_next <linux/rcupdate.h>
+
+#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 */
index bb9bc37..59be83f 100644 (file)
@@ -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