aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rtnetlink.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-08 17:15:32 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-08 17:15:32 -0400
commita6e0fc8514d41dfdd98b1d15cacc432cf040f8af (patch)
tree48a6b7cbae9fa0637b7f134b2d204740af783237 /include/linux/rtnetlink.h
parenta7a4f1c1a52912eb8b3bd4d8f628d83a8b5d69dd (diff)
net: introduce rcu_dereference_rtnl
We use rcu_dereference_check(p, rcu_read_lock_held() || lockdep_rtnl_is_held()) several times in network stack. More usages to come too, so its time to create a helper. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rtnetlink.h')
-rw-r--r--include/linux/rtnetlink.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 58d44491880f..263690d991a8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -749,6 +749,17 @@ extern int rtnl_is_locked(void);
749extern int lockdep_rtnl_is_held(void); 749extern int lockdep_rtnl_is_held(void);
750#endif /* #ifdef CONFIG_PROVE_LOCKING */ 750#endif /* #ifdef CONFIG_PROVE_LOCKING */
751 751
752/**
753 * rcu_dereference_rtnl - rcu_dereference with debug checking
754 * @p: The pointer to read, prior to dereferencing
755 *
756 * Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
757 * or RTNL
758 */
759#define rcu_dereference_rtnl(p) \
760 rcu_dereference_check(p, rcu_read_lock_held() || \
761 lockdep_rtnl_is_held())
762
752extern void rtnetlink_init(void); 763extern void rtnetlink_init(void);
753extern void __rtnl_unlock(void); 764extern void __rtnl_unlock(void);
754 765