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)
commit71bc3b2dc5d02566afe1b23a7b72bfc8acdd04e1
treea52f4d6130847f9089a5f02bec46750fec926725
parentdec1e90e8c7157a527faad95023d96dbc114fbac
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