aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-09-15 11:19:35 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-15 17:19:50 -0400
commite0974585e74cc16446bc0690f0545b72aa2a3485 (patch)
tree02f1d06b712e53d70a43ccb9f56ac05cffc2af0a
parent547942cace50e536dcda9ce8397792bc992291d6 (diff)
bonding: consolidate ASSERT_RTNL()s and remove the unnecessary
Consolidate the calls to ASSERT_RTNL() before bond_select_active_slave() inside bond_select_active_slave() itself and remove the ASSERT_RTNL() from bond_hw_addr_swap() as it's not exported and its only caller - bond_change_active_slave() already has an ASSERT_RTNL(). Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 943a899fbfde..5e7987bba583 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -577,8 +577,6 @@ static void bond_hw_addr_flush(struct net_device *bond_dev,
577static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active, 577static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
578 struct slave *old_active) 578 struct slave *old_active)
579{ 579{
580 ASSERT_RTNL();
581
582 if (old_active) { 580 if (old_active) {
583 if (bond->dev->flags & IFF_PROMISC) 581 if (bond->dev->flags & IFF_PROMISC)
584 dev_set_promiscuity(old_active->dev, -1); 582 dev_set_promiscuity(old_active->dev, -1);
@@ -876,6 +874,8 @@ void bond_select_active_slave(struct bonding *bond)
876 struct slave *best_slave; 874 struct slave *best_slave;
877 int rv; 875 int rv;
878 876
877 ASSERT_RTNL();
878
879 best_slave = bond_find_best_slave(bond); 879 best_slave = bond_find_best_slave(bond);
880 if (best_slave != rtnl_dereference(bond->curr_active_slave)) { 880 if (best_slave != rtnl_dereference(bond->curr_active_slave)) {
881 bond_change_active_slave(bond, best_slave); 881 bond_change_active_slave(bond, best_slave);
@@ -2004,7 +2004,6 @@ static void bond_miimon_commit(struct bonding *bond)
2004 } 2004 }
2005 2005
2006do_failover: 2006do_failover:
2007 ASSERT_RTNL();
2008 block_netpoll_tx(); 2007 block_netpoll_tx();
2009 bond_select_active_slave(bond); 2008 bond_select_active_slave(bond);
2010 unblock_netpoll_tx(); 2009 unblock_netpoll_tx();
@@ -2598,7 +2597,6 @@ static void bond_ab_arp_commit(struct bonding *bond)
2598 } 2597 }
2599 2598
2600do_failover: 2599do_failover:
2601 ASSERT_RTNL();
2602 block_netpoll_tx(); 2600 block_netpoll_tx();
2603 bond_select_active_slave(bond); 2601 bond_select_active_slave(bond);
2604 unblock_netpoll_tx(); 2602 unblock_netpoll_tx();