summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-02-21 13:17:19 -0800
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-03-18 17:30:52 -0400
commit3e633079e377d2b527a8390f63ceb887b5cabfbf (patch)
treeed2b9e5dea7b450a5d3e9ac7cb8e64c4b7ae14a5 /fs/nfsd
parent819a8f539acf7838d62fec20e88401ff53303cd1 (diff)
downloadlinux-3e633079e377d2b527a8390f63ceb887b5cabfbf.tar.gz
linux-3e633079e377d2b527a8390f63ceb887b5cabfbf.tar.bz2
linux-3e633079e377d2b527a8390f63ceb887b5cabfbf.zip
nfsd4: add a helper function to decide if stateid is delegation
Make this check self-documenting. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 909a7a493688..d5555850cb64 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -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
*/
@@ -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;