mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
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>
This commit is contained in:
parent
74ff0ffc7f
commit
d6d95ded91
12
fs/namei.c
12
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
|
* 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
|
* allocates a new one if not found or not valid. In the need_lookup argument
|
||||||
* returns whether i_op->lookup is necessary.
|
* 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,
|
static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
@ -2351,15 +2349,7 @@ struct dentry *lookup_one_len_unlocked(const char *name,
|
|||||||
if (err)
|
if (err)
|
||||||
return ERR_PTR(err);
|
return ERR_PTR(err);
|
||||||
|
|
||||||
/*
|
ret = lookup_dcache(&this, base, 0);
|
||||||
* __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;
|
|
||||||
}
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user