提交 7dff59ef 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net: add rtnl_dereference()

We sometime want to dereference an rcu protected pointer while
holding RTNL. Use a macro to hide all lockdep details.
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e0de7c93
......@@ -760,6 +760,15 @@ extern int lockdep_rtnl_is_held(void);
rcu_dereference_check(p, rcu_read_lock_held() || \
lockdep_rtnl_is_held())
/**
* rtnl_dereference - rcu_dereference with debug checking
* @p: The pointer to read, prior to dereferencing
*
* Do an rcu_dereference(p), but check caller holds RTNL
*/
#define rtnl_dereference(p) \
rcu_dereference_check(p, lockdep_rtnl_is_held())
extern void rtnetlink_init(void);
extern void __rtnl_unlock(void);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册