summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-02-21 11:14:43 -0800
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-03-18 17:30:52 -0400
commitdc9bf700ed2fc3eab50f31000b13fda781e7c9f1 (patch)
tree902919540f05e9cf175ce0b3942d7c2e12a8a3e2 /fs/nfsd/nfs4state.c
parent0c2a498fa6d33d8ca9c8a0c29039c41e1734cb9e (diff)
downloadop-kernel-dev-dc9bf700ed2fc3eab50f31000b13fda781e7c9f1.zip
op-kernel-dev-dc9bf700ed2fc3eab50f31000b13fda781e7c9f1.tar.gz
nfsd4: remove redundant "if" in nfs4_preprocess_stateid_op
Note that we exit this first big "if" with stp == NULL if and only if we took the first branch; therefore, the second "if" is redundant, and we can just combine the two, simplifying the logic. Reviewed-by: Yang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index d6ca2be..16fcb65 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2087,6 +2087,14 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
status = check_stateid_generation(stateid, stidp);
if (status)
goto out;
+ status = nfs4_check_delegmode(dp, flags);
+ if (status)
+ goto out;
+ renew_client(dp->dl_client);
+ if (flags & DELEG_RET)
+ unhash_delegation(dp);
+ if (filpp)
+ *filpp = dp->dl_vfs_file;
} else { /* open or lock stateid */
stp = find_stateid(stateid, flags);
if (!stp) {
@@ -2101,23 +2109,12 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
status = check_stateid_generation(stateid, stidp);
if (status)
goto out;
- }
- if (stp) {
status = nfs4_check_openmode(stp, flags);
if (status)
goto out;
renew_client(stp->st_stateowner->so_client);
if (filpp)
*filpp = stp->st_vfs_file;
- } else {
- status = nfs4_check_delegmode(dp, flags);
- if (status)
- goto out;
- renew_client(dp->dl_client);
- if (flags & DELEG_RET)
- unhash_delegation(dp);
- if (filpp)
- *filpp = dp->dl_vfs_file;
}
status = nfs_ok;
out:
OpenPOWER on IntegriCloud