diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-02-21 14:14:43 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-03-18 17:30:52 -0400 |
commit | dc9bf700ed2fc3eab50f31000b13fda781e7c9f1 (patch) | |
tree | 902919540f05e9cf175ce0b3942d7c2e12a8a3e2 /fs/nfsd/nfs4state.c | |
parent | 0c2a498fa6d33d8ca9c8a0c29039c41e1734cb9e (diff) |
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.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d6ca2be306dc..16fcb656f47f 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 | |||
2087 | status = check_stateid_generation(stateid, stidp); | 2087 | status = check_stateid_generation(stateid, stidp); |
2088 | if (status) | 2088 | if (status) |
2089 | goto out; | 2089 | goto out; |
2090 | status = nfs4_check_delegmode(dp, flags); | ||
2091 | if (status) | ||
2092 | goto out; | ||
2093 | renew_client(dp->dl_client); | ||
2094 | if (flags & DELEG_RET) | ||
2095 | unhash_delegation(dp); | ||
2096 | if (filpp) | ||
2097 | *filpp = dp->dl_vfs_file; | ||
2090 | } else { /* open or lock stateid */ | 2098 | } else { /* open or lock stateid */ |
2091 | stp = find_stateid(stateid, flags); | 2099 | stp = find_stateid(stateid, flags); |
2092 | if (!stp) { | 2100 | if (!stp) { |
@@ -2101,23 +2109,12 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl | |||
2101 | status = check_stateid_generation(stateid, stidp); | 2109 | status = check_stateid_generation(stateid, stidp); |
2102 | if (status) | 2110 | if (status) |
2103 | goto out; | 2111 | goto out; |
2104 | } | ||
2105 | if (stp) { | ||
2106 | status = nfs4_check_openmode(stp, flags); | 2112 | status = nfs4_check_openmode(stp, flags); |
2107 | if (status) | 2113 | if (status) |
2108 | goto out; | 2114 | goto out; |
2109 | renew_client(stp->st_stateowner->so_client); | 2115 | renew_client(stp->st_stateowner->so_client); |
2110 | if (filpp) | 2116 | if (filpp) |
2111 | *filpp = stp->st_vfs_file; | 2117 | *filpp = stp->st_vfs_file; |
2112 | } else { | ||
2113 | status = nfs4_check_delegmode(dp, flags); | ||
2114 | if (status) | ||
2115 | goto out; | ||
2116 | renew_client(dp->dl_client); | ||
2117 | if (flags & DELEG_RET) | ||
2118 | unhash_delegation(dp); | ||
2119 | if (filpp) | ||
2120 | *filpp = dp->dl_vfs_file; | ||
2121 | } | 2118 | } |
2122 | status = nfs_ok; | 2119 | status = nfs_ok; |
2123 | out: | 2120 | out: |