Commit a6e0fc85 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a7a4f1c1
......@@ -749,6 +749,17 @@ extern int rtnl_is_locked(void);
extern int lockdep_rtnl_is_held(void);
#endif /* #ifdef CONFIG_PROVE_LOCKING */
/**
* rcu_dereference_rtnl - rcu_dereference with debug checking
* @p: The pointer to read, prior to dereferencing
*
* Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
* or RTNL
*/
#define rcu_dereference_rtnl(p) \
rcu_dereference_check(p, rcu_read_lock_held() || \
lockdep_rtnl_is_held())
extern void rtnetlink_init(void);
extern void __rtnl_unlock(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment