aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/rtnetlink.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 0bb7b48632bd..d42f274418b8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -755,20 +755,22 @@ extern int lockdep_rtnl_is_held(void);
755 * @p: The pointer to read, prior to dereferencing 755 * @p: The pointer to read, prior to dereferencing
756 * 756 *
757 * Do an rcu_dereference(p), but check caller either holds rcu_read_lock() 757 * Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
758 * or RTNL 758 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference()
759 */ 759 */
760#define rcu_dereference_rtnl(p) \ 760#define rcu_dereference_rtnl(p) \
761 rcu_dereference_check(p, rcu_read_lock_held() || \ 761 rcu_dereference_check(p, rcu_read_lock_held() || \
762 lockdep_rtnl_is_held()) 762 lockdep_rtnl_is_held())
763 763
764/** 764/**
765 * rtnl_dereference - rcu_dereference with debug checking 765 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
766 * @p: The pointer to read, prior to dereferencing 766 * @p: The pointer to read, prior to dereferencing
767 * 767 *
768 * Do an rcu_dereference(p), but check caller holds RTNL 768 * Return the value of the specified RCU-protected pointer, but omit
769 * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because
770 * caller holds RTNL.
769 */ 771 */
770#define rtnl_dereference(p) \ 772#define rtnl_dereference(p) \
771 rcu_dereference_check(p, lockdep_rtnl_is_held()) 773 rcu_dereference_protected(p, lockdep_rtnl_is_held())
772 774
773static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev) 775static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev)
774{ 776{