• Veaceslav Falico's avatar
    bonding: rework bond_find_best_slave() to use bond_for_each_slave() · 77140d29
    Veaceslav Falico authored
    bond_find_best_slave() does not have to be balanced - i.e. return the slave
    that is *after* some other slave, but rather return the best slave that
    suits, except of bond->primary_slave - in which case we just return it if
    it's suitable.
    
    After that we just look through all the slaves and return either first up
    slave or the slave whose link came back earliest.
    
    We also don't care about curr_active_slave lock cause we use it in
    bond_should_change_active() only and there we take it right away - i.e. it
    won't go away.
    
    CC: Jay Vosburgh <fubar@us.ibm.com>
    CC: Andy Gospodarek <andy@greyhouse.net>
    Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    77140d29
bond_main.c 126 KB