diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-01-27 19:22:49 +0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-02-18 03:38:52 +0400 |
commit | 03cfb42025a16dc45195dbdd6d368daaa8367429 (patch) | |
tree | 5c1fbae03c905fb22b40f53d04e7616e413a0b3d /fs/nfsd/nfs4state.c | |
parent | de5b8e8e047534aac6bc9803f96e7257436aef9c (diff) | |
download | linux-03cfb42025a16dc45195dbdd6d368daaa8367429.tar.xz |
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.c | 9 |
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; } |