2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-19 16:14:13 +08:00

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: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2010-09-15 11:07:15 +00:00 committed by David S. Miller
parent e0de7c93b9
commit 7dff59efbb

View File

@ -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);