From e2ef95ea3041bd8545ae066f8e5132b943d736cb Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Tue, 6 Sep 2011 15:50:21 -0400 Subject: [PATCH] --- yaml --- r: 267151 b: refs/heads/master c: 2288d0e3958b94bcc3c00a78ea06909a8eb66378 h: refs/heads/master i: 267149: 08e5a5030a1e9cbe4a299a23567de6941ea2b088 267147: 9198a7ff27f0fe85565b4c148a8c26f0208b932a 267143: cd536232c51951176693b32f034a1f6efa6c2074 267135: 98ad9b908d4d636fc90297e5842aa3256cd78c65 v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfs4state.c | 18 ++++++++---------- trunk/fs/nfsd/state.h | 2 -- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index ae319c6a3569..25a9eee02aab 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c0a5d93efbbb79117bdf7f5f81fba9d679c35dfa +refs/heads/master: 2288d0e3958b94bcc3c00a78ea06909a8eb66378 diff --git a/trunk/fs/nfsd/nfs4state.c b/trunk/fs/nfsd/nfs4state.c index ad20bbf0a1f8..48134635fc2f 100644 --- a/trunk/fs/nfsd/nfs4state.c +++ b/trunk/fs/nfsd/nfs4state.c @@ -1080,16 +1080,14 @@ static struct nfs4_stateid *find_stateid(stateid_t *t) return NULL; } -static struct nfs4_stateid *find_stateid_by_type(stateid_t *t, int flags) +static struct nfs4_stateid *find_stateid_by_type(stateid_t *t, char typemask) { struct nfs4_stateid *s; s = find_stateid(t); if (!s) return NULL; - if (flags & LOCK_STATE && s->st_type == NFS4_LOCK_STID) - return s; - if (flags & OPEN_STATE && s->st_type == NFS4_OPEN_STID) + if (typemask & s->st_type) return s; return NULL; } @@ -3445,7 +3443,7 @@ static __be32 nfs4_seqid_op_checks(struct nfsd4_compound_state *cstate, stateid_ */ static __be32 nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid, - stateid_t *stateid, int flags, + stateid_t *stateid, char typemask, struct nfs4_stateid **stpp) { __be32 status; @@ -3457,7 +3455,7 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid, status = nfs4_nospecial_stateid_checks(stateid); if (status) return status; - *stpp = find_stateid_by_type(stateid, flags); + *stpp = find_stateid_by_type(stateid, typemask); if (*stpp == NULL) return nfserr_expired; cstate->replay_owner = (*stpp)->st_stateowner; @@ -3472,7 +3470,7 @@ static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cs struct nfs4_openowner *oo; status = nfs4_preprocess_seqid_op(cstate, seqid, stateid, - OPEN_STATE, stpp); + NFS4_OPEN_STID, stpp); if (status) return status; oo = openowner((*stpp)->st_stateowner); @@ -3501,7 +3499,7 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, status = nfs4_preprocess_seqid_op(cstate, oc->oc_seqid, &oc->oc_req_stateid, - OPEN_STATE, &stp); + NFS4_OPEN_STID, &stp); if (status) goto out; oo = openowner(stp->st_stateowner); @@ -3999,7 +3997,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, status = nfs4_preprocess_seqid_op(cstate, lock->lk_old_lock_seqid, &lock->lk_old_lock_stateid, - LOCK_STATE, &lock_stp); + NFS4_LOCK_STID, &lock_stp); if (status) goto out; lock_sop = lockowner(lock_stp->st_stateowner); @@ -4197,7 +4195,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, nfs4_lock_state(); status = nfs4_preprocess_seqid_op(cstate, locku->lu_seqid, - &locku->lu_stateid, LOCK_STATE, &stp); + &locku->lu_stateid, NFS4_LOCK_STID, &stp); if (status) goto out; filp = find_any_file(stp->st_file); diff --git a/trunk/fs/nfsd/state.h b/trunk/fs/nfsd/state.h index 9745cc781e74..ef949eb3a86e 100644 --- a/trunk/fs/nfsd/state.h +++ b/trunk/fs/nfsd/state.h @@ -463,8 +463,6 @@ struct nfs4_stateid { }; /* flags for preprocess_seqid_op() */ -#define OPEN_STATE 0x00000004 -#define LOCK_STATE 0x00000008 #define RD_STATE 0x00000010 #define WR_STATE 0x00000020