OSDN Git Service

nfsd4: look up stateid's per clientid
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 23 Sep 2011 21:01:19 +0000 (17:01 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 26 Sep 2011 21:35:28 +0000 (17:35 -0400)
commit38c2f4b12a455cb3a108fd5c79a10df2ba3ec9a7
tree125aa30a29a2863b448d66b2b0d31d4f65db0533
parent36279ac10c3d69372af875f1affafd375db687a9
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>
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/state.h