Skip to content

Commit

Permalink
bonding: consolidate ASSERT_RTNL()s and remove the unnecessary
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Sep 15, 2014
1 parent 547942c commit e097458
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,6 @@ static void bond_hw_addr_flush(struct net_device *bond_dev,
static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
struct slave *old_active)
{
ASSERT_RTNL();

if (old_active) {
if (bond->dev->flags & IFF_PROMISC)
dev_set_promiscuity(old_active->dev, -1);
Expand Down Expand Up @@ -876,6 +874,8 @@ void bond_select_active_slave(struct bonding *bond)
struct slave *best_slave;
int rv;

ASSERT_RTNL();

best_slave = bond_find_best_slave(bond);
if (best_slave != rtnl_dereference(bond->curr_active_slave)) {
bond_change_active_slave(bond, best_slave);
Expand Down Expand Up @@ -2004,7 +2004,6 @@ static void bond_miimon_commit(struct bonding *bond)
}

do_failover:
ASSERT_RTNL();
block_netpoll_tx();
bond_select_active_slave(bond);
unblock_netpoll_tx();
Expand Down Expand Up @@ -2598,7 +2597,6 @@ static void bond_ab_arp_commit(struct bonding *bond)
}

do_failover:
ASSERT_RTNL();
block_netpoll_tx();
bond_select_active_slave(bond);
unblock_netpoll_tx();
Expand Down

0 comments on commit e097458

Please sign in to comment.