aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-09-09 17:16:59 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-09 20:31:35 -0400
commitecfede424e95b211050f777c3ae96356926ed1c4 (patch)
tree5e8a29b7de762bcb4e39e1dac1235c6cdd215334 /drivers/net/bonding
parentbdbc5f13036c13ba47dad5f99645556fc40381f0 (diff)
bonding: alb: clean bond->lock
We can remove the lock/unlock as it's no longer necessary since RTNL should be held while calling bond_alb_set_mac_address(). Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_alb.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 73c21e233131..028496205f39 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1775,8 +1775,7 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char
1775 * Set the bond->curr_active_slave to @new_slave and handle 1775 * Set the bond->curr_active_slave to @new_slave and handle
1776 * mac address swapping and promiscuity changes as needed. 1776 * mac address swapping and promiscuity changes as needed.
1777 * 1777 *
1778 * If new_slave is NULL, caller must hold curr_slave_lock or 1778 * If new_slave is NULL, caller must hold curr_slave_lock for write
1779 * bond->lock for write.
1780 * 1779 *
1781 * If new_slave is not NULL, caller must hold RTNL, curr_slave_lock 1780 * If new_slave is not NULL, caller must hold RTNL, curr_slave_lock
1782 * for write. Processing here may sleep, so no other locks may be held. 1781 * for write. Processing here may sleep, so no other locks may be held.
@@ -1857,12 +1856,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
1857 write_lock_bh(&bond->curr_slave_lock); 1856 write_lock_bh(&bond->curr_slave_lock);
1858} 1857}
1859 1858
1860/* 1859/* Called with RTNL */
1861 * Called with RTNL
1862 */
1863int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) 1860int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
1864 __acquires(&bond->lock)
1865 __releases(&bond->lock)
1866{ 1861{
1867 struct bonding *bond = netdev_priv(bond_dev); 1862 struct bonding *bond = netdev_priv(bond_dev);
1868 struct sockaddr *sa = addr; 1863 struct sockaddr *sa = addr;
@@ -1895,14 +1890,12 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
1895 } else { 1890 } else {
1896 alb_set_slave_mac_addr(curr_active, bond_dev->dev_addr); 1891 alb_set_slave_mac_addr(curr_active, bond_dev->dev_addr);
1897 1892
1898 read_lock(&bond->lock);
1899 alb_send_learning_packets(curr_active, 1893 alb_send_learning_packets(curr_active,
1900 bond_dev->dev_addr, false); 1894 bond_dev->dev_addr, false);
1901 if (bond->alb_info.rlb_enabled) { 1895 if (bond->alb_info.rlb_enabled) {
1902 /* inform clients mac address has changed */ 1896 /* inform clients mac address has changed */
1903 rlb_req_update_slave_clients(bond, curr_active); 1897 rlb_req_update_slave_clients(bond, curr_active);
1904 } 1898 }
1905 read_unlock(&bond->lock);
1906 } 1899 }
1907 1900
1908 return 0; 1901 return 0;