backports: add rcu_dereference_rtnl
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 31 May 2013 19:15:23 +0000 (21:15 +0200)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 6 Jun 2013 03:41:38 +0000 (20:41 -0700)
Add backport for rcu_dereference_rtnl()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
backport/backport-include/linux/rtnetlink.h

index 56ba9f6a313a5c3a8b78f1abf07cf65ecccea165..81540a3645623692ac60f1d4785de9fc1502125d 100644 (file)
@@ -7,6 +7,12 @@
         rcu_dereference_protected(p, lockdep_rtnl_is_held())
 #endif
 
+#ifndef rcu_dereference_rtnl
+#define rcu_dereference_rtnl(p)                                        \
+       rcu_dereference_check(p, rcu_read_lock_held() ||        \
+                                lockdep_rtnl_is_held())
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
 #ifdef CONFIG_PROVE_LOCKING
 /*