OSDN Git Service

bonding: clean curr_slave_lock use
authorNikolay Aleksandrov <nikolay@redhat.com>
Thu, 11 Sep 2014 20:49:24 +0000 (22:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Sep 2014 20:29:06 +0000 (16:29 -0400)
commit1c72cfdc96e63bf975cab514c4ca4d8a661ba0e6
treeac7531a979920c5282f07fb71ad9f2c6a64d8ac4
parent62c5f5185397f4bd8e5defe6fcb86420deeb2b38
bonding: clean curr_slave_lock use

Mostly all users of curr_slave_lock already have RTNL as we've discussed
previously so there's no point in using it, the one case where the lock
must stay is the 3ad code, in fact it's the only one.
It's okay to remove it from bond_do_fail_over_mac() as it's called with
RTNL and drops the curr_slave_lock anyway.
bond_change_active_slave() is one of the main places where
curr_slave_lock was used, it's okay to remove it as all callers use RTNL
these days before calling it, that's why we move the ASSERT_RTNL() in
the beginning to catch any potential offenders to this rule.
The RTNL argument actually applies to all of the places where
curr_slave_lock has been removed from in this patch.
Also remove the unnecessary bond_deref_active_protected() macro and use
rtnl_dereference() instead.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_options.c
drivers/net/bonding/bonding.h