summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov2014-09-11 22:49:25 +0200
committerDavid S. Miller2014-09-13 22:29:07 +0200
commitb743562819bd97cc7c282e870896bae8016b64b5 (patch)
tree609840f05bf9dd7c1d6fec0c6e447e305bd866a7 /drivers/net/bonding/bond_main.c
parentbonding: clean curr_slave_lock use (diff)
downloadkernel-qcow2-linux-b743562819bd97cc7c282e870896bae8016b64b5.tar.gz
kernel-qcow2-linux-b743562819bd97cc7c282e870896bae8016b64b5.tar.xz
kernel-qcow2-linux-b743562819bd97cc7c282e870896bae8016b64b5.zip
bonding: convert curr_slave_lock to a spinlock and rename it
curr_slave_lock is now a misleading name, a much better name is mode_lock as it'll be used for each mode's purposes and it's no longer necessary to use a rwlock, a simple spinlock is enough. Suggested-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 3b06685260b8..99d21c2fd44f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1679,9 +1679,9 @@ static int __bond_release_one(struct net_device *bond_dev,
/* Sync against bond_3ad_rx_indication and
* bond_3ad_state_machine_handler
*/
- write_lock_bh(&bond->curr_slave_lock);
+ spin_lock_bh(&bond->mode_lock);
bond_3ad_unbind_slave(slave);
- write_unlock_bh(&bond->curr_slave_lock);
+ spin_unlock_bh(&bond->mode_lock);
}
netdev_info(bond_dev, "Releasing %s interface %s\n",
@@ -3850,8 +3850,7 @@ void bond_setup(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
- /* initialize rwlocks */
- rwlock_init(&bond->curr_slave_lock);
+ spin_lock_init(&bond->mode_lock);
bond->params = bonding_defaults;
/* Initialize pointers */