diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2011-06-02 14:59:08 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-12 13:40:27 -0400 |
commit | 7d9747947ae66d8f6a9a9a023a3a5e28df6a536e (patch) | |
tree | f0fc49559d1653e7e1e8597cf07f9f04cff9d237 /fs/nfs/nfs4proc.c | |
parent | fca78d6d2c77f87d7dbee89bbe4836a44da881e2 (diff) |
NFS: Added TEST_STATEID call
This patch adds in the xdr for doing a TEST_STATEID call with a single
stateid. RFC 5661 allows multiple stateids to be tested in a single
call, but only testing one keeps things simpler for now.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 892bff53f61d..5612ba997db7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6015,6 +6015,34 @@ out_freepage: | |||
6015 | out: | 6015 | out: |
6016 | return err; | 6016 | return err; |
6017 | } | 6017 | } |
6018 | static int _nfs41_test_stateid(struct nfs_server *server, struct nfs4_state *state) | ||
6019 | { | ||
6020 | int status; | ||
6021 | struct nfs41_test_stateid_args args = { | ||
6022 | .stateid = &state->stateid, | ||
6023 | }; | ||
6024 | struct nfs41_test_stateid_res res; | ||
6025 | struct rpc_message msg = { | ||
6026 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_TEST_STATEID], | ||
6027 | .rpc_argp = &args, | ||
6028 | .rpc_resp = &res, | ||
6029 | }; | ||
6030 | args.seq_args.sa_session = res.seq_res.sr_session = NULL; | ||
6031 | status = nfs4_call_sync_sequence(server->client, server, &msg, &args.seq_args, &res.seq_res, 0, 1); | ||
6032 | return status; | ||
6033 | } | ||
6034 | |||
6035 | static int nfs41_test_stateid(struct nfs_server *server, struct nfs4_state *state) | ||
6036 | { | ||
6037 | struct nfs4_exception exception = { }; | ||
6038 | int err; | ||
6039 | do { | ||
6040 | err = nfs4_handle_exception(server, | ||
6041 | _nfs41_test_stateid(server, state), | ||
6042 | &exception); | ||
6043 | } while (exception.retry); | ||
6044 | return err; | ||
6045 | } | ||
6018 | #endif /* CONFIG_NFS_V4_1 */ | 6046 | #endif /* CONFIG_NFS_V4_1 */ |
6019 | 6047 | ||
6020 | struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops = { | 6048 | struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops = { |