diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2014-09-11 22:49:24 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-13 16:29:06 -0400 |
commit | 1c72cfdc96e63bf975cab514c4ca4d8a661ba0e6 (patch) | |
tree | ac7531a979920c5282f07fb71ad9f2c6a64d8ac4 /drivers/net/bonding/bonding.h | |
parent | 62c5f5185397f4bd8e5defe6fcb86420deeb2b38 (diff) | |
download | op-kernel-dev-1c72cfdc96e63bf975cab514c4ca4d8a661ba0e6.zip op-kernel-dev-1c72cfdc96e63bf975cab514c4ca4d8a661ba0e6.tar.gz |
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>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 78c461a..02afdeb 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -184,9 +184,7 @@ struct slave { /* * Here are the locking policies for the two bonding locks: - * - * 1) Get rcu_read_lock when reading or RTNL when writing slave list. - * 2) Get bond->curr_slave_lock when reading/writing bond->curr_active_slave. + * Get rcu_read_lock when reading or RTNL when writing slave list. */ struct bonding { struct net_device *dev; /* first - useful for panic debug */ @@ -227,10 +225,6 @@ struct bonding { #define bond_slave_get_rtnl(dev) \ ((struct slave *) rtnl_dereference(dev->rx_handler_data)) -#define bond_deref_active_protected(bond) \ - rcu_dereference_protected(bond->curr_active_slave, \ - lockdep_is_held(&bond->curr_slave_lock)) - struct bond_vlan_tag { __be16 vlan_proto; unsigned short vlan_id; |