datapath: Move rcu_read_lock_held(), rcu_dereference_*() to rcupdate.h.
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / linux / rcupdate.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 */