]> git.baikalelectronics.ru Git - kernel.git/commit
bonding: remove unnecessary read_locks of curr_slave_lock
authornikolay@redhat.com <nikolay@redhat.com>
Thu, 1 Aug 2013 14:54:48 +0000 (16:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Aug 2013 23:42:02 +0000 (16:42 -0700)
commit52cfb2ca7d41d920ed434cdae27e64c37a68ac4f
treea52f4d6130847f9089a5f02bec46750fec926725
parent89ee93c6a0fcad4a7b8185c16449160ca1f9505d
bonding: remove unnecessary read_locks of curr_slave_lock

In all the cases we already hold bond->lock for reading, so the slave
can't get away and the check != NULL is sufficient. curr_active_slave
can still change after the read_lock is unlocked prior to use of the
dereferenced value, so there's no need for it. It either contains a
valid slave which we use (and can't get away), or it is NULL which is
checked.
In some places the read_lock of curr_slave_lock was left because we need
it not to change while performing some action (e.g. syncing current
active slave's addresses, sending ARP requests through the active slave)
such cases will be dealt with individually while converting to RCU.

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