aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-06-30 11:48:43 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-07-09 20:55:01 -0400
commit2dd6e458c3dc1ae598867130dc618eabbe7ccda5 (patch)
tree87e9f353cd5e4084d81c2ce45dab57995ffed6b8 /fs/nfsd/nfs4state.c
parentd4e19e70276a320bbc01b76fb50b5c4962ff523a (diff)
nfsd: Cleanup - Let nfsd4_lookup_stateid() take a cstate argument
The cstate already holds information about the session, and hence the client id, so it makes more sense to pass that information rather than the current practice of passing a 'minor version' number. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 29d1ddc098bc..1f8aab8f67ba 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3781,12 +3781,14 @@ static __be32 nfsd4_validate_stateid(struct nfs4_client *cl, stateid_t *stateid)
3781 } 3781 }
3782} 3782}
3783 3783
3784static __be32 nfsd4_lookup_stateid(stateid_t *stateid, unsigned char typemask, 3784static __be32
3785 struct nfs4_stid **s, bool sessions, 3785nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate,
3786 struct nfsd_net *nn) 3786 stateid_t *stateid, unsigned char typemask,
3787 struct nfs4_stid **s, struct nfsd_net *nn)
3787{ 3788{
3788 struct nfs4_client *cl; 3789 struct nfs4_client *cl;
3789 __be32 status; 3790 __be32 status;
3791 bool sessions = cstate->minorversion != 0;
3790 3792
3791 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) 3793 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid))
3792 return nfserr_bad_stateid; 3794 return nfserr_bad_stateid;
@@ -3832,9 +3834,9 @@ nfs4_preprocess_stateid_op(struct net *net, struct nfsd4_compound_state *cstate,
3832 3834
3833 nfs4_lock_state(); 3835 nfs4_lock_state();
3834 3836
3835 status = nfsd4_lookup_stateid(stateid, 3837 status = nfsd4_lookup_stateid(cstate, stateid,
3836 NFS4_DELEG_STID|NFS4_OPEN_STID|NFS4_LOCK_STID, 3838 NFS4_DELEG_STID|NFS4_OPEN_STID|NFS4_LOCK_STID,
3837 &s, cstate->minorversion, nn); 3839 &s, nn);
3838 if (status) 3840 if (status)
3839 goto out; 3841 goto out;
3840 status = check_stateid_generation(stateid, &s->sc_stateid, nfsd4_has_session(cstate)); 3842 status = check_stateid_generation(stateid, &s->sc_stateid, nfsd4_has_session(cstate));
@@ -4004,8 +4006,7 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
4004 seqid, STATEID_VAL(stateid)); 4006 seqid, STATEID_VAL(stateid));
4005 4007
4006 *stpp = NULL; 4008 *stpp = NULL;
4007 status = nfsd4_lookup_stateid(stateid, typemask, &s, 4009 status = nfsd4_lookup_stateid(cstate, stateid, typemask, &s, nn);
4008 cstate->minorversion, nn);
4009 if (status) 4010 if (status)
4010 return status; 4011 return status;
4011 stp = openlockstateid(s); 4012 stp = openlockstateid(s);
@@ -4229,8 +4230,7 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
4229 return status; 4230 return status;
4230 4231
4231 nfs4_lock_state(); 4232 nfs4_lock_state();
4232 status = nfsd4_lookup_stateid(stateid, NFS4_DELEG_STID, &s, 4233 status = nfsd4_lookup_stateid(cstate, stateid, NFS4_DELEG_STID, &s, nn);
4233 cstate->minorversion, nn);
4234 if (status) 4234 if (status)
4235 goto out; 4235 goto out;
4236 dp = delegstateid(s); 4236 dp = delegstateid(s);