[prev in list] [next in list] [prev in thread] [next in thread]
List: git-commits-head
Subject: untangling do_lookup() - take __lookup_hash()-calling case out of line.
From: "Linux Kernel Mailing List" <linux-kernel () vger ! kernel ! org>
Date: 2012-03-31 21:21:06
Message-ID: 20120331212106.088177C00DF () ra ! kernel ! org
[Download RAW message or body]
Gitweb: http://git.kernel.org/linus/;a=commit;h=81e6f520898edbda56e8680d338ace4f5694874e
Commit: 81e6f520898edbda56e8680d338ace4f5694874e
Parent: a32555466caee38faeef4e44d7878ecbff1199bc
Author: Al Viro <viro@zeniv.linux.org.uk>
AuthorDate: Fri Mar 30 14:48:04 2012 -0400
Committer: Al Viro <viro@zeniv.linux.org.uk>
CommitDate: Sat Mar 31 16:03:17 2012 -0400
untangling do_lookup() - take __lookup_hash()-calling case out of line.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/namei.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index a919aff..5eeec56 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1208,22 +1208,14 @@ unlazy:
dentry = __d_lookup(parent, name);
}
- if (dentry && unlikely(d_need_lookup(dentry))) {
+ if (unlikely(!dentry))
+ goto need_lookup;
+
+ if (unlikely(d_need_lookup(dentry))) {
dput(dentry);
- dentry = NULL;
+ goto need_lookup;
}
-retry:
- if (unlikely(!dentry)) {
- struct inode *dir = parent->d_inode;
- BUG_ON(nd->inode != dir);
- mutex_lock(&dir->i_mutex);
- dentry = __lookup_hash(name, parent, nd);
- mutex_unlock(&dir->i_mutex);
- if (IS_ERR(dentry))
- return PTR_ERR(dentry);
- goto done;
- }
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
@@ -1233,8 +1225,7 @@ retry:
}
if (!d_invalidate(dentry)) {
dput(dentry);
- dentry = NULL;
- goto retry;
+ goto need_lookup;
}
}
done:
@@ -1249,6 +1240,16 @@ done:
nd->flags |= LOOKUP_JUMPED;
*inode = path->dentry->d_inode;
return 0;
+
+need_lookup:
+ BUG_ON(nd->inode != parent->d_inode);
+
+ mutex_lock(&parent->d_inode->i_mutex);
+ dentry = __lookup_hash(name, parent, nd);
+ mutex_unlock(&parent->d_inode->i_mutex);
+ if (IS_ERR(dentry))
+ return PTR_ERR(dentry);
+ goto done;
}
static inline int may_lookup(struct nameidata *nd)
--
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