aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-09-25 03:20:25 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-26 16:02:07 -0400
commitc8c23903f12a62708606b5cdba8cd8550cd6bdcd (patch)
tree0ec00d047bf91019e91ff79384ea17244b81981f /drivers/net/bonding
parent5a52405a30abf70a60312ad4231385699f09cb85 (diff)
bonding: remove bond_prev_slave()
We don't really need it, and it's really hard to RCUify the list->prev. CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c9
-rw-r--r--drivers/net/bonding/bonding.h4
2 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 06ffc8ace54c..6aa345a6a0bc 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1255,7 +1255,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1255{ 1255{
1256 struct bonding *bond = netdev_priv(bond_dev); 1256 struct bonding *bond = netdev_priv(bond_dev);
1257 const struct net_device_ops *slave_ops = slave_dev->netdev_ops; 1257 const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
1258 struct slave *new_slave = NULL; 1258 struct slave *new_slave = NULL, *prev_slave;
1259 struct sockaddr addr; 1259 struct sockaddr addr;
1260 int link_reporting; 1260 int link_reporting;
1261 int res = 0, i; 1261 int res = 0, i;
@@ -1472,6 +1472,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1472 1472
1473 write_lock_bh(&bond->lock); 1473 write_lock_bh(&bond->lock);
1474 1474
1475 prev_slave = bond_last_slave(bond);
1475 bond_attach_slave(bond, new_slave); 1476 bond_attach_slave(bond, new_slave);
1476 1477
1477 new_slave->delay = 0; 1478 new_slave->delay = 0;
@@ -1566,9 +1567,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1566 */ 1567 */
1567 bond_3ad_initialize(bond, 1000/AD_TIMER_INTERVAL); 1568 bond_3ad_initialize(bond, 1000/AD_TIMER_INTERVAL);
1568 } else { 1569 } else {
1569 struct slave *prev_slave;
1570
1571 prev_slave = bond_prev_slave(bond, new_slave);
1572 SLAVE_AD_INFO(new_slave).id = 1570 SLAVE_AD_INFO(new_slave).id =
1573 SLAVE_AD_INFO(prev_slave).id + 1; 1571 SLAVE_AD_INFO(prev_slave).id + 1;
1574 } 1572 }
@@ -3506,9 +3504,8 @@ static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
3506 */ 3504 */
3507 3505
3508 bond_for_each_slave(bond, slave, iter) { 3506 bond_for_each_slave(bond, slave, iter) {
3509 pr_debug("s %p s->p %p c_m %p\n", 3507 pr_debug("s %p c_m %p\n",
3510 slave, 3508 slave,
3511 bond_prev_slave(bond, slave),
3512 slave->dev->netdev_ops->ndo_change_mtu); 3509 slave->dev->netdev_ops->ndo_change_mtu);
3513 3510
3514 res = dev_set_mtu(slave->dev, new_mtu); 3511 res = dev_set_mtu(slave->dev, new_mtu);
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 3eb464cb8744..454d6affa06a 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -96,10 +96,6 @@
96 (bond_is_last_slave(bond, pos) ? bond_first_slave(bond) : \ 96 (bond_is_last_slave(bond, pos) ? bond_first_slave(bond) : \
97 bond_to_slave((pos)->list.next)) 97 bond_to_slave((pos)->list.next))
98 98
99#define bond_prev_slave(bond, pos) \
100 (bond_is_first_slave(bond, pos) ? bond_last_slave(bond) : \
101 bond_to_slave((pos)->list.prev))
102
103/** 99/**
104 * bond_for_each_slave - iterate over all slaves 100 * bond_for_each_slave - iterate over all slaves
105 * @bond: the bond holding this list 101 * @bond: the bond holding this list