* [PATCH net-next 8/9] bonding: remove unwanted lock for bond enslave and release
@ 2013-11-06 6:53 Ding Tianhong
0 siblings, 0 replies; only message in thread
From: Ding Tianhong @ 2013-11-06 6:53 UTC (permalink / raw)
To: Jay Vosburgh, Andy Gospodarek, David S. Miller,
Nikolay Aleksandrov, Veaceslav Falico, Netdev
The bond_change_active_slave() and bond_select_active_slave()
was no longer need bond lock and curr_slave_lock, the enslave
and release will always in RTNL, so remove the unwanted lock.
Signed-off-by: Ding Tianhong <dingtianhong@huawei•com>
---
drivers/net/bonding/bond_main.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index dc17a85..d2d70dc 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1565,13 +1565,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
bond_compute_features(bond);
bond_set_carrier(bond);
- if (USES_PRIMARY(bond->params.mode)) {
- read_lock(&bond->lock);
- write_lock_bh(&bond->curr_slave_lock);
+ if (USES_PRIMARY(bond->params.mode))
bond_select_active_slave(bond);
- write_unlock_bh(&bond->curr_slave_lock);
- read_unlock(&bond->lock);
- }
pr_info("%s: enslaving %s as a%s interface with a%s link.\n",
bond_dev->name, slave_dev->name,
@@ -1590,19 +1585,11 @@ err_detach:
bond_hw_addr_flush(bond_dev, slave_dev);
vlan_vids_del_by_dev(slave_dev, bond_dev);
- write_lock_bh(&bond->lock);
if (bond->primary_slave == new_slave)
bond->primary_slave = NULL;
if (bond->curr_active_slave == new_slave) {
bond_change_active_slave(bond, NULL);
- write_unlock_bh(&bond->lock);
- read_lock(&bond->lock);
- write_lock_bh(&bond->curr_slave_lock);
bond_select_active_slave(bond);
- write_unlock_bh(&bond->curr_slave_lock);
- read_unlock(&bond->lock);
- } else {
- write_unlock_bh(&bond->lock);
}
slave_disable_netpoll(new_slave);
@@ -1743,13 +1730,9 @@ static int __bond_release_one(struct net_device *bond_dev,
* will interfere.
*/
write_unlock_bh(&bond->lock);
- read_lock(&bond->lock);
- write_lock_bh(&bond->curr_slave_lock);
bond_select_active_slave(bond);
- write_unlock_bh(&bond->curr_slave_lock);
- read_unlock(&bond->lock);
write_lock_bh(&bond->lock);
}
--
1.8.2.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-06 6:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 6:53 [PATCH net-next 8/9] bonding: remove unwanted lock for bond enslave and release Ding Tianhong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox