summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorBryan Schumaker2012-01-27 16:22:49 +0100
committerJ. Bruce Fields2012-02-18 00:38:52 +0100
commit03cfb42025a16dc45195dbdd6d368daaa8367429 (patch)
tree5c1fbae03c905fb22b40f53d04e7616e413a0b3d /fs/nfsd/nfs4state.c
parentlockd: fix arg parsing for grace_period and timeout. (diff)
downloadkernel-qcow2-linux-03cfb42025a16dc45195dbdd6d368daaa8367429.tar.gz
kernel-qcow2-linux-03cfb42025a16dc45195dbdd6d368daaa8367429.tar.xz
kernel-qcow2-linux-03cfb42025a16dc45195dbdd6d368daaa8367429.zip
NFSD: Clean up the test_stateid function
When I initially wrote it, I didn't understand how lists worked so I wrote something that didn't use them. I think making a list of stateids to test is a more straightforward implementation, especially compared to especially compared to decoding stateids while simultaneously encoding a reply to the client. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 45966a436b0a..f1b74a74ec49 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3402,7 +3402,14 @@ __be32
nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct nfsd4_test_stateid *test_stateid)
{
- /* real work is done during encoding */
+ struct nfsd4_test_stateid_id *stateid;
+ struct nfs4_client *cl = cstate->session->se_client;
+
+ nfs4_lock_state();
+ list_for_each_entry(stateid, &test_stateid->ts_stateid_list, ts_id_list)
+ stateid->ts_id_status = nfs4_validate_stateid(cl, &stateid->ts_id_stateid);
+ nfs4_unlock_state();
+
return nfs_ok;
}