Commit a03ece5f authored by Al Viro's avatar Al Viro

fold lookup_real() into __lookup_hash()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 903ddaf4
...@@ -1473,43 +1473,36 @@ static struct dentry *lookup_dcache(const struct qstr *name, ...@@ -1473,43 +1473,36 @@ static struct dentry *lookup_dcache(const struct qstr *name,
} }
/* /*
* Call i_op->lookup on the dentry. The dentry must be negative and * Parent directory has inode locked exclusive. This is one
* unhashed. * and only case when ->lookup() gets called on non in-lookup
* * dentries - as the matter of fact, this only gets called
* dir->d_inode->i_mutex must be held * when directory is guaranteed to have no in-lookup children
* at all.
*/ */
static struct dentry *lookup_real(struct inode *dir, struct dentry *dentry,
unsigned int flags)
{
struct dentry *old;
/* Don't create child dentry for a dead directory. */
if (unlikely(IS_DEADDIR(dir))) {
dput(dentry);
return ERR_PTR(-ENOENT);
}
old = dir->i_op->lookup(dir, dentry, flags);
if (unlikely(old)) {
dput(dentry);
dentry = old;
}
return dentry;
}
static struct dentry *__lookup_hash(const struct qstr *name, static struct dentry *__lookup_hash(const struct qstr *name,
struct dentry *base, unsigned int flags) struct dentry *base, unsigned int flags)
{ {
struct dentry *dentry = lookup_dcache(name, base, flags); struct dentry *dentry = lookup_dcache(name, base, flags);
struct dentry *old;
struct inode *dir = base->d_inode;
if (dentry) if (dentry)
return dentry; return dentry;
/* Don't create child dentry for a dead directory. */
if (unlikely(IS_DEADDIR(dir)))
return ERR_PTR(-ENOENT);
dentry = d_alloc(base, name); dentry = d_alloc(base, name);
if (unlikely(!dentry)) if (unlikely(!dentry))
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
return lookup_real(base->d_inode, dentry, flags); old = dir->i_op->lookup(dir, dentry, flags);
if (unlikely(old)) {
dput(dentry);
dentry = old;
}
return dentry;
} }
static int lookup_fast(struct nameidata *nd, static int lookup_fast(struct nameidata *nd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment