[prev in list] [next in list] [prev in thread] [next in thread]
List: git-commits-head
Subject: untangling do_lookup() - get rid of need_reval in !dentry case
From: "Linux Kernel Mailing List" <linux-kernel () vger ! kernel ! org>
Date: 2012-03-31 21:21:05
Message-ID: 20120331212105.DF8E27C00DA () ra ! kernel ! org
[Download RAW message or body]
Gitweb: http://git.kernel.org/linus/;a=commit;h=08b0ab7c20f767187ae635d51bdd9d262ebe8357
Commit: 08b0ab7c20f767187ae635d51bdd9d262ebe8357
Parent: acc9cb3cd425f479d8fc4a441bff45dce23aa6dd
Author: Al Viro <viro@zeniv.linux.org.uk>
AuthorDate: Fri Mar 30 14:18:50 2012 -0400
Committer: Al Viro <viro@zeniv.linux.org.uk>
CommitDate: Sat Mar 31 16:03:16 2012 -0400
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>
---
fs/namei.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 9ce43a3..14bb00a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1181,7 +1181,6 @@ retry:
return PTR_ERR(dentry);
}
/* known good */
- need_reval = 0;
status = 1;
} else if (unlikely(d_need_lookup(dentry))) {
dentry = d_inode_lookup(parent, dentry, nd);
@@ -1190,10 +1189,8 @@ retry:
return PTR_ERR(dentry);
}
/* known good */
- need_reval = 0;
status = 1;
- }
- if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
+ } else if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
if (status < 0) {
@@ -1209,7 +1206,6 @@ retry:
return PTR_ERR(dentry);
}
/* known good */
- need_reval = 0;
status = 1;
}
}
@@ -1226,7 +1222,6 @@ retry:
if (!d_invalidate(dentry)) {
dput(dentry);
dentry = NULL;
- need_reval = 1;
goto retry;
}
}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic