diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e165c53db08f..18a4d5a9a4e9 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -356,9 +356,9 @@ nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *free_slot) | |||
356 | } | 356 | } |
357 | 357 | ||
358 | /* | 358 | /* |
359 | * Signal state manager thread if session is drained | 359 | * Signal state manager thread if session fore channel is drained |
360 | */ | 360 | */ |
361 | static void nfs41_check_drain_session_complete(struct nfs4_session *ses) | 361 | static void nfs4_check_drain_fc_complete(struct nfs4_session *ses) |
362 | { | 362 | { |
363 | struct rpc_task *task; | 363 | struct rpc_task *task; |
364 | 364 | ||
@@ -372,8 +372,20 @@ static void nfs41_check_drain_session_complete(struct nfs4_session *ses) | |||
372 | if (ses->fc_slot_table.highest_used_slotid != -1) | 372 | if (ses->fc_slot_table.highest_used_slotid != -1) |
373 | return; | 373 | return; |
374 | 374 | ||
375 | dprintk("%s COMPLETE: Session Drained\n", __func__); | 375 | dprintk("%s COMPLETE: Session Fore Channel Drained\n", __func__); |
376 | complete(&ses->complete); | 376 | complete(&ses->fc_slot_table.complete); |
377 | } | ||
378 | |||
379 | /* | ||
380 | * Signal state manager thread if session back channel is drained | ||
381 | */ | ||
382 | void nfs4_check_drain_bc_complete(struct nfs4_session *ses) | ||
383 | { | ||
384 | if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state) || | ||
385 | ses->bc_slot_table.highest_used_slotid != -1) | ||
386 | return; | ||
387 | dprintk("%s COMPLETE: Session Back Channel Drained\n", __func__); | ||
388 | complete(&ses->bc_slot_table.complete); | ||
377 | } | 389 | } |
378 | 390 | ||
379 | static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) | 391 | static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) |
@@ -390,7 +402,7 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) | |||
390 | 402 | ||
391 | spin_lock(&tbl->slot_tbl_lock); | 403 | spin_lock(&tbl->slot_tbl_lock); |
392 | nfs4_free_slot(tbl, res->sr_slot); | 404 | nfs4_free_slot(tbl, res->sr_slot); |
393 | nfs41_check_drain_session_complete(res->sr_session); | 405 | nfs4_check_drain_fc_complete(res->sr_session); |
394 | spin_unlock(&tbl->slot_tbl_lock); | 406 | spin_unlock(&tbl->slot_tbl_lock); |
395 | res->sr_slot = NULL; | 407 | res->sr_slot = NULL; |
396 | } | 408 | } |
@@ -4777,17 +4789,17 @@ struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp) | |||
4777 | if (!session) | 4789 | if (!session) |
4778 | return NULL; | 4790 | return NULL; |
4779 | 4791 | ||
4780 | init_completion(&session->complete); | ||
4781 | |||
4782 | tbl = &session->fc_slot_table; | 4792 | tbl = &session->fc_slot_table; |
4783 | tbl->highest_used_slotid = -1; | 4793 | tbl->highest_used_slotid = -1; |
4784 | spin_lock_init(&tbl->slot_tbl_lock); | 4794 | spin_lock_init(&tbl->slot_tbl_lock); |
4785 | rpc_init_priority_wait_queue(&tbl->slot_tbl_waitq, "ForeChannel Slot table"); | 4795 | rpc_init_priority_wait_queue(&tbl->slot_tbl_waitq, "ForeChannel Slot table"); |
4796 | init_completion(&tbl->complete); | ||
4786 | 4797 | ||
4787 | tbl = &session->bc_slot_table; | 4798 | tbl = &session->bc_slot_table; |
4788 | tbl->highest_used_slotid = -1; | 4799 | tbl->highest_used_slotid = -1; |
4789 | spin_lock_init(&tbl->slot_tbl_lock); | 4800 | spin_lock_init(&tbl->slot_tbl_lock); |
4790 | rpc_init_wait_queue(&tbl->slot_tbl_waitq, "BackChannel Slot table"); | 4801 | rpc_init_wait_queue(&tbl->slot_tbl_waitq, "BackChannel Slot table"); |
4802 | init_completion(&tbl->complete); | ||
4791 | 4803 | ||
4792 | session->session_state = 1<<NFS4_SESSION_INITING; | 4804 | session->session_state = 1<<NFS4_SESSION_INITING; |
4793 | 4805 | ||