aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-03 17:49:01 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-04 16:31:50 -0500
commit471cb5a33dcbd7c529684a2ac7ba4451414ee4a7 (patch)
tree8bf8fa62166a62acb7737bf257b0eb82da8e1be1 /drivers/net/bonding/bonding.h
parent7f6e7101dfcc228151779354f6cdc5e1d62f576b (diff)
bonding: remove usage of dev->master
Benefit from new upper dev list and free bonding from dev->master usage. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 21b68e5c14fd..0d282d20b5a8 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -258,6 +258,9 @@ static inline bool bond_vlan_used(struct bonding *bond)
258#define bond_slave_get_rcu(dev) \ 258#define bond_slave_get_rcu(dev) \
259 ((struct slave *) rcu_dereference(dev->rx_handler_data)) 259 ((struct slave *) rcu_dereference(dev->rx_handler_data))
260 260
261#define bond_slave_get_rtnl(dev) \
262 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
263
261/** 264/**
262 * Returns NULL if the net_device does not belong to any of the bond's slaves 265 * Returns NULL if the net_device does not belong to any of the bond's slaves
263 * 266 *
@@ -280,11 +283,9 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
280 283
281static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) 284static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
282{ 285{
283 if (!slave || !slave->dev->master) { 286 if (!slave || !slave->bond)
284 return NULL; 287 return NULL;
285 } 288 return slave->bond;
286
287 return netdev_priv(slave->dev->master);
288} 289}
289 290
290static inline bool bond_is_lb(const struct bonding *bond) 291static inline bool bond_is_lb(const struct bonding *bond)
@@ -360,10 +361,9 @@ static inline void bond_netpoll_send_skb(const struct slave *slave,
360 361
361static inline void bond_set_slave_inactive_flags(struct slave *slave) 362static inline void bond_set_slave_inactive_flags(struct slave *slave)
362{ 363{
363 struct bonding *bond = netdev_priv(slave->dev->master); 364 if (!bond_is_lb(slave->bond))
364 if (!bond_is_lb(bond))
365 bond_set_backup_slave(slave); 365 bond_set_backup_slave(slave);
366 if (!bond->params.all_slaves_active) 366 if (!slave->bond->params.all_slaves_active)
367 slave->inactive = 1; 367 slave->inactive = 1;
368} 368}
369 369