diff options
author | Andy Adamson <andros@netapp.com> | 2009-04-01 09:22:34 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 15:24:55 -0400 |
commit | 0f3e66c6a6cae479028d31198288e524fe5ff90d (patch) | |
tree | e221fc927077a22485d5befc0136f1e77ecc55c5 /fs/nfs/nfs4proc.c | |
parent | 96b09e024fedf0a6604c8c688a3994d5ed991434 (diff) |
nfs41: destroy_session operation
Implement the destroy_session operation conforming to
http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26
Signed-off-by: Ricardo Labiaga <ricardo.labiaga@netapp.com>
Signed-off-by: Andy Adamson<andros@umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: remove extraneous rpc_clnt pointer]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41; NFS_CS_READY required for DESTROY_SESSION]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: pass *session in seq_args and seq_res]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
[nfs41: fix encode_destroy_session's xdr Xcoding pointer type]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4d7a8b9e1291..59e8bf5b10bb 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4532,6 +4532,36 @@ out: | |||
4532 | return status; | 4532 | return status; |
4533 | } | 4533 | } |
4534 | 4534 | ||
4535 | /* | ||
4536 | * Issue the over-the-wire RPC DESTROY_SESSION. | ||
4537 | * The caller must serialize access to this routine. | ||
4538 | */ | ||
4539 | int nfs4_proc_destroy_session(struct nfs4_session *session) | ||
4540 | { | ||
4541 | int status = 0; | ||
4542 | struct rpc_message msg; | ||
4543 | |||
4544 | dprintk("--> nfs4_proc_destroy_session\n"); | ||
4545 | |||
4546 | /* session is still being setup */ | ||
4547 | if (session->clp->cl_cons_state != NFS_CS_READY) | ||
4548 | return status; | ||
4549 | |||
4550 | msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_DESTROY_SESSION]; | ||
4551 | msg.rpc_argp = session; | ||
4552 | msg.rpc_resp = NULL; | ||
4553 | msg.rpc_cred = NULL; | ||
4554 | status = rpc_call_sync(session->clp->cl_rpcclient, &msg, 0); | ||
4555 | |||
4556 | if (status) | ||
4557 | printk(KERN_WARNING | ||
4558 | "Got error %d from the server on DESTROY_SESSION. " | ||
4559 | "Session has been destroyed regardless...\n", status); | ||
4560 | |||
4561 | dprintk("<-- nfs4_proc_destroy_session\n"); | ||
4562 | return status; | ||
4563 | } | ||
4564 | |||
4535 | #endif /* CONFIG_NFS_V4_1 */ | 4565 | #endif /* CONFIG_NFS_V4_1 */ |
4536 | 4566 | ||
4537 | struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { | 4567 | struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { |