aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-09-23 17:01:19 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-09-26 17:35:28 -0400
commit38c2f4b12a455cb3a108fd5c79a10df2ba3ec9a7 (patch)
tree125aa30a29a2863b448d66b2b0d31d4f65db0533 /fs/nfsd/nfs4xdr.c
parent36279ac10c3d69372af875f1affafd375db687a9 (diff)
nfsd4: look up stateid's per clientid
Use a separate stateid idr per client, and lookup a stateid by first finding the client, then looking up the stateid relative to that client. Also some minor refactoring. This allows us to improve error returns: we can return expired when the clientid is not found and bad_stateid when the clientid is found but not the stateid, as opposed to returning expired for both cases. I hope this will also help to replace the state lock mostly by a per-client lock, but that hasn't been done yet. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 2429fffa31dd..5779acde7e70 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3287,6 +3287,7 @@ nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, int nfserr,
3287 struct nfsd4_test_stateid *test_stateid) 3287 struct nfsd4_test_stateid *test_stateid)
3288{ 3288{
3289 struct nfsd4_compoundargs *argp; 3289 struct nfsd4_compoundargs *argp;
3290 struct nfs4_client *cl = resp->cstate.session->se_client;
3290 stateid_t si; 3291 stateid_t si;
3291 __be32 *p; 3292 __be32 *p;
3292 int i; 3293 int i;
@@ -3302,7 +3303,7 @@ nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, int nfserr,
3302 nfs4_lock_state(); 3303 nfs4_lock_state();
3303 for (i = 0; i < test_stateid->ts_num_ids; i++) { 3304 for (i = 0; i < test_stateid->ts_num_ids; i++) {
3304 nfsd4_decode_stateid(argp, &si); 3305 nfsd4_decode_stateid(argp, &si);
3305 valid = nfs4_validate_stateid(&si); 3306 valid = nfs4_validate_stateid(cl, &si);
3306 RESERVE_SPACE(4); 3307 RESERVE_SPACE(4);
3307 *p++ = htonl(valid); 3308 *p++ = htonl(valid);
3308 resp->p = p; 3309 resp->p = p;