diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-30 14:18:50 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-31 16:03:16 -0400 |
commit | 08b0ab7c20f767187ae635d51bdd9d262ebe8357 (patch) | |
tree | b3b7258f1bee1574df231279dec23fe0c92a2b46 /fs/namei.c | |
parent | acc9cb3cd425f479d8fc4a441bff45dce23aa6dd (diff) |
untangling do_lookup() - get rid of need_reval in !dentry case
Everything arriving into if (!dentry) will have need_reval = 1.
Indeed, the only way to get there with need_reval reset to 0 would
be via
if (unlikely(d_need_lookup(dentry)))
goto unlazy;
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
if (status != -ECHILD)
need_reval = 0;
goto unlazy;
...
unlazy:
/* no assignments to dentry */
if (dentry && unlikely(d_need_lookup(dentry))) {
dput(dentry);
dentry = NULL;
}
and if d_need_lookup() had already been false the first time around, it
will remain false on the second call as well.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c index 9ce43a358c33..14bb00a9fa9a 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1181,7 +1181,6 @@ retry: | |||
1181 | return PTR_ERR(dentry); | 1181 | return PTR_ERR(dentry); |
1182 | } | 1182 | } |
1183 | /* known good */ | 1183 | /* known good */ |
1184 | need_reval = 0; | ||
1185 | status = 1; | 1184 | status = 1; |
1186 | } else if (unlikely(d_need_lookup(dentry))) { | 1185 | } else if (unlikely(d_need_lookup(dentry))) { |
1187 | dentry = d_inode_lookup(parent, dentry, nd); | 1186 | dentry = d_inode_lookup(parent, dentry, nd); |
@@ -1190,10 +1189,8 @@ retry: | |||
1190 | return PTR_ERR(dentry); | 1189 | return PTR_ERR(dentry); |
1191 | } | 1190 | } |
1192 | /* known good */ | 1191 | /* known good */ |
1193 | need_reval = 0; | ||
1194 | status = 1; | 1192 | status = 1; |
1195 | } | 1193 | } else if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) |
1196 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) | ||
1197 | status = d_revalidate(dentry, nd); | 1194 | status = d_revalidate(dentry, nd); |
1198 | if (unlikely(status <= 0)) { | 1195 | if (unlikely(status <= 0)) { |
1199 | if (status < 0) { | 1196 | if (status < 0) { |
@@ -1209,7 +1206,6 @@ retry: | |||
1209 | return PTR_ERR(dentry); | 1206 | return PTR_ERR(dentry); |
1210 | } | 1207 | } |
1211 | /* known good */ | 1208 | /* known good */ |
1212 | need_reval = 0; | ||
1213 | status = 1; | 1209 | status = 1; |
1214 | } | 1210 | } |
1215 | } | 1211 | } |
@@ -1226,7 +1222,6 @@ retry: | |||
1226 | if (!d_invalidate(dentry)) { | 1222 | if (!d_invalidate(dentry)) { |
1227 | dput(dentry); | 1223 | dput(dentry); |
1228 | dentry = NULL; | 1224 | dentry = NULL; |
1229 | need_reval = 1; | ||
1230 | goto retry; | 1225 | goto retry; |
1231 | } | 1226 | } |
1232 | } | 1227 | } |