• Y
    tipc: remove bearer_lock from tipc_bearer struct · a8304529
    Ying Xue 提交于
    After the earlier commits ("tipc: remove 'links' list from
    tipc_bearer struct") and ("tipc: introduce new spinlock to protect
    struct link_req"), there is no longer any need to protect struct
    link_req or or any link list by use of bearer_lock. Furthermore,
    we have eliminated the need for using bearer_lock during downcalls
    (send) from the link to the bearer, since we have ensured that
    bearers always have a longer life cycle that their associated links,
    and always contain valid data.
    
    So, the only need now for a lock protecting bearers is for guaranteeing
    consistency of the bearer list itself. For this, it is sufficient, at
    least for the time being, to continue applying 'net_lock´ in write mode.
    
    By removing bearer_lock we also pre-empt introduction of issue b) descibed
    in the previous commit "tipc: remove 'links' list from tipc_bearer struct":
    
    "b) When the outer protection from net_lock is gone, taking
        bearer_lock and node_lock in opposite order of method 1) and 2)
        will become an obvious deadlock hazard".
    
    Therefore, we now eliminate the bearer_lock spinlock.
    Signed-off-by: NYing Xue <ying.xue@windriver.com>
    Reviewed-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    a8304529
bearer.h 7.0 KB