X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fklnds%2Fptllnd%2Fptllnd_peer.c;fp=lnet%2Fklnds%2Fptllnd%2Fptllnd_peer.c;h=ebed094526caa2a508de8ce89f0b591c7787ccbf;hp=6cc44f001ed7dd1e074a6fc8cc4df0666c2a2466;hb=e089a515efae3391709b997be889ebe0f3306e9d;hpb=8c47378b057e72d6125f4baffe8721e0734d0d3f diff --git a/lnet/klnds/ptllnd/ptllnd_peer.c b/lnet/klnds/ptllnd/ptllnd_peer.c index 6cc44f0..ebed094 100644 --- a/lnet/klnds/ptllnd/ptllnd_peer.c +++ b/lnet/klnds/ptllnd/ptllnd_peer.c @@ -424,37 +424,37 @@ kptllnd_handle_closing_peers () void kptllnd_peer_close_locked(kptl_peer_t *peer, int why) { - switch (peer->peer_state) { - default: - LBUG(); - - case PEER_STATE_WAITING_HELLO: - case PEER_STATE_ACTIVE: - /* Ensure new peers see a new incarnation of me */ - LASSERT(peer->peer_myincarnation <= kptllnd_data.kptl_incarnation); - if (peer->peer_myincarnation == kptllnd_data.kptl_incarnation) - kptllnd_data.kptl_incarnation++; - - /* Removing from peer table */ - kptllnd_data.kptl_n_active_peers--; - LASSERT (kptllnd_data.kptl_n_active_peers >= 0); - - cfs_list_del(&peer->peer_list); - kptllnd_peer_unreserve_buffers(); - - peer->peer_error = why; /* stash 'why' only on first close */ - peer->peer_state = PEER_STATE_CLOSING; - - /* Schedule for immediate attention, taking peer table's ref */ - cfs_list_add_tail(&peer->peer_list, - &kptllnd_data.kptl_closing_peers); - cfs_waitq_signal(&kptllnd_data.kptl_watchdog_waitq); - break; - - case PEER_STATE_ZOMBIE: - case PEER_STATE_CLOSING: - break; - } + switch (peer->peer_state) { + default: + LBUG(); + + case PEER_STATE_WAITING_HELLO: + case PEER_STATE_ACTIVE: + /* Ensure new peers see a new incarnation of me */ + LASSERT(peer->peer_myincarnation <= kptllnd_data.kptl_incarnation); + if (peer->peer_myincarnation == kptllnd_data.kptl_incarnation) + kptllnd_data.kptl_incarnation++; + + /* Removing from peer table */ + kptllnd_data.kptl_n_active_peers--; + LASSERT (kptllnd_data.kptl_n_active_peers >= 0); + + cfs_list_del(&peer->peer_list); + kptllnd_peer_unreserve_buffers(); + + peer->peer_error = why; /* stash 'why' only on first close */ + peer->peer_state = PEER_STATE_CLOSING; + + /* Schedule for immediate attention, taking peer table's ref */ + cfs_list_add_tail(&peer->peer_list, + &kptllnd_data.kptl_closing_peers); + wake_up(&kptllnd_data.kptl_watchdog_waitq); + break; + + case PEER_STATE_ZOMBIE: + case PEER_STATE_CLOSING: + break; + } } void