提交 3e633079 编写于 作者: J J. Bruce Fields

nfsd4: add a helper function to decide if stateid is delegation

Make this check self-documenting.
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
上级 819a8f53
...@@ -2048,6 +2048,11 @@ static int check_stateid_generation(stateid_t *in, stateid_t *ref) ...@@ -2048,6 +2048,11 @@ static int check_stateid_generation(stateid_t *in, stateid_t *ref)
return nfs_ok; return nfs_ok;
} }
static int is_delegation_stateid(stateid_t *stateid)
{
return stateid->si_fileid == 0;
}
/* /*
* Checks for stateid operations * Checks for stateid operations
*/ */
...@@ -2073,7 +2078,7 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl ...@@ -2073,7 +2078,7 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
goto out; goto out;
status = nfserr_bad_stateid; status = nfserr_bad_stateid;
if (!stateid->si_fileid) { /* delegation stateid */ if (is_delegation_stateid(stateid)) {
dp = find_delegation_stateid(ino, stateid); dp = find_delegation_stateid(ino, stateid);
if (!dp) if (!dp)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册