diff options
author | Alexandros Batsakis <batsakis@netapp.com> | 2009-12-09 01:50:11 -0800 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-15 13:50:01 -0500 |
commit | 3bfb0fc59192f7fffae0a1caada8dc68af53997a (patch) | |
tree | ad4c11861dc1e5d50875c725cca3723332b05be2 /fs/nfs | |
parent | 3ea6b3d0e6d0ffd91c0f8cadeb69b7133c038b32 (diff) | |
download | op-kernel-dev-3bfb0fc59192f7fffae0a1caada8dc68af53997a.zip op-kernel-dev-3bfb0fc59192f7fffae0a1caada8dc68af53997a.tar.gz |
nfs: minor cleanup of session draining
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 9f5f11e..d117a7b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -341,6 +341,23 @@ nfs4_free_slot(struct nfs4_slot_table *tbl, u8 free_slotid) free_slotid, tbl->highest_used_slotid); } +/* + * Signal state manager thread if session is drained + */ +static void nfs41_check_drain_session_complete(struct nfs4_session *ses) +{ + if (!test_bit(NFS4CLNT_SESSION_DRAINING, &ses->clp->cl_state)) { + rpc_wake_up_next(&ses->fc_slot_table.slot_tbl_waitq); + return; + } + + if (ses->fc_slot_table.highest_used_slotid != -1) + return; + + dprintk("%s COMPLETE: Session Drained\n", __func__); + complete(&ses->complete); +} + static void nfs41_sequence_free_slot(const struct nfs_client *clp, struct nfs4_sequence_res *res) { @@ -356,15 +373,7 @@ static void nfs41_sequence_free_slot(const struct nfs_client *clp, spin_lock(&tbl->slot_tbl_lock); nfs4_free_slot(tbl, res->sr_slotid); - - /* Signal state manager thread if session is drained */ - if (test_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state)) { - if (tbl->highest_used_slotid == -1) { - dprintk("%s COMPLETE: Session Drained\n", __func__); - complete(&clp->cl_session->complete); - } - } else - rpc_wake_up_next(&tbl->slot_tbl_waitq); + nfs41_check_drain_session_complete(clp->cl_session); spin_unlock(&tbl->slot_tbl_lock); res->sr_slotid = NFS4_MAX_SLOT_TABLE; } |