aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-07-15 06:56:55 -0700
committerDavid S. Miller <davem@davemloft.net>2014-07-15 17:49:42 -0700
commit4740d6382790077f22c606d03804f5d9f15b90d7 (patch)
tree4f607b2f834ba4f547312136316d606d62fcdac0 /drivers/net/bonding/bonding.h
parentbonding: use rcu_access_pointer() in bonding_show_mii_status() (diff)
downloadlinux-dev-4740d6382790077f22c606d03804f5d9f15b90d7.tar.xz
linux-dev-4740d6382790077f22c606d03804f5d9f15b90d7.zip
bonding: add proper __rcu annotation for curr_active_slave
RCU was added to bonding in linux-3.12 but lacked proper sparse annotations. Using __rcu annotation actually helps to spot all accesses to bond->curr_active_slave are correctly protected, with LOCKDEP support. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Veaceslav Falico <vfalico@gmail.com> Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/bonding/bonding.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 713e2a99c661..d03d2ae4d3af 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -194,7 +194,7 @@ struct slave {
*/
struct bonding {
struct net_device *dev; /* first - useful for panic debug */
- struct slave *curr_active_slave;
+ struct slave __rcu *curr_active_slave;
struct slave *current_arp_slave;
struct slave *primary_slave;
bool force_primary;
@@ -232,6 +232,10 @@ struct bonding {
#define bond_slave_get_rtnl(dev) \
((struct slave *) rtnl_dereference(dev->rx_handler_data))
+#define bond_deref_active_protected(bond) \
+ rcu_dereference_protected(bond->curr_active_slave, \
+ lockdep_is_held(&bond->curr_slave_lock))
+
struct bond_vlan_tag {
__be16 vlan_proto;
unsigned short vlan_id;