aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index e9e4d6393f1b..0b0f11be40f9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -445,8 +445,10 @@ nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot)
445 u32 new_max = find_last_bit(tbl->used_slots, slotid); 445 u32 new_max = find_last_bit(tbl->used_slots, slotid);
446 if (new_max < slotid) 446 if (new_max < slotid)
447 tbl->highest_used_slotid = new_max; 447 tbl->highest_used_slotid = new_max;
448 else 448 else {
449 tbl->highest_used_slotid = NFS4_NO_SLOT; 449 tbl->highest_used_slotid = NFS4_NO_SLOT;
450 nfs4_session_drain_complete(tbl->session, tbl);
451 }
450 } 452 }
451 dprintk("%s: slotid %u highest_used_slotid %d\n", __func__, 453 dprintk("%s: slotid %u highest_used_slotid %d\n", __func__,
452 slotid, tbl->highest_used_slotid); 454 slotid, tbl->highest_used_slotid);
@@ -458,36 +460,6 @@ bool nfs4_set_task_privileged(struct rpc_task *task, void *dummy)
458 return true; 460 return true;
459} 461}
460 462
461/*
462 * Signal state manager thread if session fore channel is drained
463 */
464static void nfs4_check_drain_fc_complete(struct nfs4_session *ses)
465{
466 if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state)) {
467 rpc_wake_up_first(&ses->fc_slot_table.slot_tbl_waitq,
468 nfs4_set_task_privileged, NULL);
469 return;
470 }
471
472 if (ses->fc_slot_table.highest_used_slotid != NFS4_NO_SLOT)
473 return;
474
475 dprintk("%s COMPLETE: Session Fore Channel Drained\n", __func__);
476 complete(&ses->fc_slot_table.complete);
477}
478
479/*
480 * Signal state manager thread if session back channel is drained
481 */
482void nfs4_check_drain_bc_complete(struct nfs4_session *ses)
483{
484 if (!test_bit(NFS4_SESSION_DRAINING, &ses->session_state) ||
485 ses->bc_slot_table.highest_used_slotid != NFS4_NO_SLOT)
486 return;
487 dprintk("%s COMPLETE: Session Back Channel Drained\n", __func__);
488 complete(&ses->bc_slot_table.complete);
489}
490
491static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) 463static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
492{ 464{
493 struct nfs4_session *session; 465 struct nfs4_session *session;
@@ -504,7 +476,9 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
504 476
505 spin_lock(&tbl->slot_tbl_lock); 477 spin_lock(&tbl->slot_tbl_lock);
506 nfs4_free_slot(tbl, res->sr_slot); 478 nfs4_free_slot(tbl, res->sr_slot);
507 nfs4_check_drain_fc_complete(session); 479 if (!nfs4_session_draining(session))
480 rpc_wake_up_first(&tbl->slot_tbl_waitq,
481 nfs4_set_task_privileged, NULL);
508 spin_unlock(&tbl->slot_tbl_lock); 482 spin_unlock(&tbl->slot_tbl_lock);
509 res->sr_slot = NULL; 483 res->sr_slot = NULL;
510} 484}