diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-03 08:28:38 +0300 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 17:41:19 -0700 |
commit | e10e0cfc2f27364c73b28adbd3c8688d97049e73 (patch) | |
tree | bc674e4140ea34b7893c14425ad43a930655743c /fs/nfsd/nfs4state.c | |
parent | bf864a31d50e3e94d6e76537b97d664913906ff8 (diff) | |
download | kernel_samsung_smdk4412-e10e0cfc2f27364c73b28adbd3c8688d97049e73.zip kernel_samsung_smdk4412-e10e0cfc2f27364c73b28adbd3c8688d97049e73.tar.gz kernel_samsung_smdk4412-e10e0cfc2f27364c73b28adbd3c8688d97049e73.tar.bz2 |
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.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 04a395f..9192e5b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1422,7 +1422,34 @@ nfsd4_destroy_session(struct svc_rqst *r, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_session *sessionid) { - return -1; /* stub */ + struct nfsd4_session *ses; + u32 status = nfserr_badsession; + + /* Notes: + * - The confirmed nfs4_client->cl_sessionid holds destroyed sessinid + * - Should we return nfserr_back_chan_busy if waiting for + * callbacks on to-be-destroyed session? + * - Do we need to clear any callback info from previous session? + */ + + dump_sessionid(__func__, &sessionid->sessionid); + spin_lock(&sessionid_lock); + ses = find_in_sessionid_hashtbl(&sessionid->sessionid); + if (!ses) { + spin_unlock(&sessionid_lock); + goto out; + } + + unhash_session(ses); + spin_unlock(&sessionid_lock); + + /* wait for callbacks */ + shutdown_callback_client(ses->se_client); + nfsd4_put_session(ses); + status = nfs_ok; +out: + dprintk("%s returns %d\n", __func__, ntohl(status)); + return status; } __be32 |