Skip to content

Commit

Permalink
nfsd4: add a helper function to decide if stateid is delegation
Browse files Browse the repository at this point in the history
Make this check self-documenting.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
J. Bruce Fields committed Mar 18, 2009
1 parent 819a8f5 commit 3e63307
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,11 @@ static int check_stateid_generation(stateid_t *in, stateid_t *ref)
return nfs_ok;
}

static int is_delegation_stateid(stateid_t *stateid)
{
return stateid->si_fileid == 0;
}

/*
* Checks for stateid operations
*/
Expand All @@ -2073,7 +2078,7 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
goto out;

status = nfserr_bad_stateid;
if (!stateid->si_fileid) { /* delegation stateid */
if (is_delegation_stateid(stateid)) {
dp = find_delegation_stateid(ino, stateid);
if (!dp)
goto out;
Expand Down

0 comments on commit 3e63307

Please sign in to comment.