aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2009-04-03 01:28:38 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-04-03 20:41:19 -0400
commite10e0cfc2f27364c73b28adbd3c8688d97049e73 (patch)
treebc674e4140ea34b7893c14425ad43a930655743c /fs/nfsd/nfs4state.c
parentbf864a31d50e3e94d6e76537b97d664913906ff8 (diff)
nfsd41: destroy_session operation
Implement the destory_session operation confoming to http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26 [use sessionid_lock spin lock] Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 04a395fb5dce..9192e5b35f42 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1422,7 +1422,34 @@ nfsd4_destroy_session(struct svc_rqst *r,
1422 struct nfsd4_compound_state *cstate, 1422 struct nfsd4_compound_state *cstate,
1423 struct nfsd4_destroy_session *sessionid) 1423 struct nfsd4_destroy_session *sessionid)
1424{ 1424{
1425 return -1; /* stub */ 1425 struct nfsd4_session *ses;
1426 u32 status = nfserr_badsession;
1427
1428 /* Notes:
1429 * - The confirmed nfs4_client->cl_sessionid holds destroyed sessinid
1430 * - Should we return nfserr_back_chan_busy if waiting for
1431 * callbacks on to-be-destroyed session?
1432 * - Do we need to clear any callback info from previous session?
1433 */
1434
1435 dump_sessionid(__func__, &sessionid->sessionid);
1436 spin_lock(&sessionid_lock);
1437 ses = find_in_sessionid_hashtbl(&sessionid->sessionid);
1438 if (!ses) {
1439 spin_unlock(&sessionid_lock);
1440 goto out;
1441 }
1442
1443 unhash_session(ses);
1444 spin_unlock(&sessionid_lock);
1445
1446 /* wait for callbacks */
1447 shutdown_callback_client(ses->se_client);
1448 nfsd4_put_session(ses);
1449 status = nfs_ok;
1450out:
1451 dprintk("%s returns %d\n", __func__, ntohl(status));
1452 return status;
1426} 1453}
1427 1454
1428__be32 1455__be32