We're only using those flags to choose lock or open stateid's at this
point.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-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;
{
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)
*/
static __be32
nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
*/
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;
struct nfs4_stateid **stpp)
{
__be32 status;
status = nfs4_nospecial_stateid_checks(stateid);
if (status)
return status;
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;
if (*stpp == NULL)
return nfserr_expired;
cstate->replay_owner = (*stpp)->st_stateowner;
struct nfs4_openowner *oo;
status = nfs4_preprocess_seqid_op(cstate, seqid, stateid,
struct nfs4_openowner *oo;
status = nfs4_preprocess_seqid_op(cstate, seqid, stateid,
if (status)
return status;
oo = openowner((*stpp)->st_stateowner);
if (status)
return status;
oo = openowner((*stpp)->st_stateowner);
status = nfs4_preprocess_seqid_op(cstate,
oc->oc_seqid, &oc->oc_req_stateid,
status = nfs4_preprocess_seqid_op(cstate,
oc->oc_seqid, &oc->oc_req_stateid,
if (status)
goto out;
oo = openowner(stp->st_stateowner);
if (status)
goto out;
oo = openowner(stp->st_stateowner);
status = nfs4_preprocess_seqid_op(cstate,
lock->lk_old_lock_seqid,
&lock->lk_old_lock_stateid,
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);
if (status)
goto out;
lock_sop = lockowner(lock_stp->st_stateowner);
nfs4_lock_state();
status = nfs4_preprocess_seqid_op(cstate, locku->lu_seqid,
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);
if (status)
goto out;
filp = find_any_file(stp->st_file);
};
/* flags for preprocess_seqid_op() */
};
/* flags for preprocess_seqid_op() */
-#define OPEN_STATE 0x00000004
-#define LOCK_STATE 0x00000008
#define RD_STATE 0x00000010
#define WR_STATE 0x00000020
#define RD_STATE 0x00000010
#define WR_STATE 0x00000020