diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-03-05 22:31:50 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-03-14 00:15:36 -0400 |
commit | d6d95ded914eb321b0a2c8c26cdf0a225a0d9917 (patch) | |
tree | 1569fe898c263ae0437c8690cee87be8ac7ece1e | |
parent | 74ff0ffc7f0682cb4c00252807d76116b95ecb9e (diff) | |
download | linux-stable-d6d95ded914eb321b0a2c8c26cdf0a225a0d9917.tar.gz linux-stable-d6d95ded914eb321b0a2c8c26cdf0a225a0d9917.tar.bz2 linux-stable-d6d95ded914eb321b0a2c8c26cdf0a225a0d9917.zip |
lookup_one_len_unlocked(): use lookup_dcache()
No need to lock parent just because of ->d_revalidate() on child;
contrary to the stale comment, lookup_dcache() *can* be used without
locking the parent. Result can be moved as soon as we return, of
course, but the same is true for lookup_one_len_unlocked() itself.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/namei.c b/fs/namei.c index 955e886c8e2a..ae673355c386 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1444,8 +1444,6 @@ static int follow_dotdot(struct nameidata *nd) * This looks up the name in dcache, possibly revalidates the old dentry and * allocates a new one if not found or not valid. In the need_lookup argument * returns whether i_op->lookup is necessary. - * - * dir->d_inode->i_mutex must be held */ static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir, unsigned int flags) @@ -2351,15 +2349,7 @@ struct dentry *lookup_one_len_unlocked(const char *name, if (err) return ERR_PTR(err); - /* - * __d_lookup() is used to try to get a quick answer and avoid the - * mutex. A false-negative does no harm. - */ - ret = __d_lookup(base, &this); - if (ret && unlikely(ret->d_flags & DCACHE_OP_REVALIDATE)) { - dput(ret); - ret = NULL; - } + ret = lookup_dcache(&this, base, 0); if (ret) return ret; |