Commit 4cbfc9f7 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

nfsd: Migrate the stateid reference into nfs4_preprocess_seqid_op

Allow nfs4_preprocess_seqid_op to take the stateid reference, instead
of having all the callers do so.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 0667b1e9
...@@ -4390,8 +4390,11 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid, ...@@ -4390,8 +4390,11 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
cstate->replay_owner = stp->st_stateowner; cstate->replay_owner = stp->st_stateowner;
status = nfs4_seqid_op_checks(cstate, stateid, seqid, stp); status = nfs4_seqid_op_checks(cstate, stateid, seqid, stp);
if (!status) if (!status) {
/* FIXME: move into find_stateid_by_type */
atomic_inc(&stp->st_stid.sc_count);
*stpp = stp; *stpp = stp;
}
return status; return status;
} }
...@@ -4400,16 +4403,18 @@ static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cs ...@@ -4400,16 +4403,18 @@ static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cs
{ {
__be32 status; __be32 status;
struct nfs4_openowner *oo; struct nfs4_openowner *oo;
struct nfs4_ol_stateid *stp;
status = nfs4_preprocess_seqid_op(cstate, seqid, stateid, status = nfs4_preprocess_seqid_op(cstate, seqid, stateid,
NFS4_OPEN_STID, stpp, nn); NFS4_OPEN_STID, &stp, nn);
if (status) if (status)
return status; return status;
/* FIXME: move into nfs4_preprocess_seqid_op */ oo = openowner(stp->st_stateowner);
atomic_inc(&(*stpp)->st_stid.sc_count); if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) {
oo = openowner((*stpp)->st_stateowner); nfs4_put_stid(&stp->st_stid);
if (!(oo->oo_flags & NFS4_OO_CONFIRMED))
return nfserr_bad_stateid; return nfserr_bad_stateid;
}
*stpp = stp;
return nfs_ok; return nfs_ok;
} }
...@@ -4436,8 +4441,6 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -4436,8 +4441,6 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
NFS4_OPEN_STID, &stp, nn); NFS4_OPEN_STID, &stp, nn);
if (status) if (status)
goto out; goto out;
/* FIXME: move into nfs4_preprocess_seqid_op */
atomic_inc(&stp->st_stid.sc_count);
oo = openowner(stp->st_stateowner); oo = openowner(stp->st_stateowner);
status = nfserr_bad_stateid; status = nfserr_bad_stateid;
if (oo->oo_flags & NFS4_OO_CONFIRMED) if (oo->oo_flags & NFS4_OO_CONFIRMED)
...@@ -4587,8 +4590,6 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -4587,8 +4590,6 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
nfsd4_bump_seqid(cstate, status); nfsd4_bump_seqid(cstate, status);
if (status) if (status)
goto out; goto out;
/* FIXME: move into nfs4_preprocess_seqid_op */
atomic_inc(&stp->st_stid.sc_count);
update_stateid(&stp->st_stid.sc_stateid); update_stateid(&stp->st_stid.sc_stateid);
memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); memcpy(&close->cl_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t));
...@@ -4944,9 +4945,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -4944,9 +4945,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
lock->lk_old_lock_seqid, lock->lk_old_lock_seqid,
&lock->lk_old_lock_stateid, &lock->lk_old_lock_stateid,
NFS4_LOCK_STID, &lock_stp, nn); NFS4_LOCK_STID, &lock_stp, nn);
/* FIXME: move into nfs4_preprocess_seqid_op */
if (!status)
atomic_inc(&lock_stp->st_stid.sc_count);
} }
if (status) if (status)
goto out; goto out;
...@@ -5175,8 +5173,6 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -5175,8 +5173,6 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
&stp, nn); &stp, nn);
if (status) if (status)
goto out; goto out;
/* FIXME: move into nfs4_preprocess_seqid_op */
atomic_inc(&stp->st_stid.sc_count);
filp = find_any_file(stp->st_stid.sc_file); filp = find_any_file(stp->st_stid.sc_file);
if (!filp) { if (!filp) {
status = nfserr_lock_range; status = nfserr_lock_range;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment