datapath: Check for backported rcu_read_lock_held.
authorJesse Gross <jesse@nicira.com>
Tue, 8 Feb 2011 01:22:58 +0000 (17:22 -0800)
committerJesse Gross <jesse@nicira.com>
Tue, 8 Feb 2011 02:29:22 +0000 (18:29 -0800)
New versions of Xen backport this function.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
acinclude.m4
datapath/linux-2.6/compat-2.6/include/linux/rcupdate.h

index fed950bd4cb2f266585ec4c6286b260183a76f9c..6a829d596416fa72ae97f50b1ff6bbe3d474f964 100644 (file)
@@ -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
index f96299f4c5822e070dbe9e811405604df6401232..99459ea71f69e624506a64de180f834b51b6e34d 100644 (file)
@@ -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;