hostfs_lookup: switch to d_splice_alias()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
ce397d215c
commit
50f3074011
|
@ -610,33 +610,21 @@ static struct dentry *hostfs_lookup(struct inode *ino, struct dentry *dentry,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
inode = hostfs_iget(ino->i_sb);
|
inode = hostfs_iget(ino->i_sb);
|
||||||
if (IS_ERR(inode)) {
|
if (IS_ERR(inode))
|
||||||
err = PTR_ERR(inode);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
name = dentry_name(dentry);
|
name = dentry_name(dentry);
|
||||||
if (name == NULL)
|
if (name) {
|
||||||
goto out_put;
|
|
||||||
|
|
||||||
err = read_name(inode, name);
|
err = read_name(inode, name);
|
||||||
|
|
||||||
__putname(name);
|
__putname(name);
|
||||||
if (err == -ENOENT) {
|
|
||||||
iput(inode);
|
|
||||||
inode = NULL;
|
|
||||||
}
|
}
|
||||||
else if (err)
|
if (err) {
|
||||||
goto out_put;
|
|
||||||
|
|
||||||
d_add(dentry, inode);
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
out_put:
|
|
||||||
iput(inode);
|
iput(inode);
|
||||||
|
inode = (err == -ENOENT) ? NULL : ERR_PTR(err);
|
||||||
|
}
|
||||||
out:
|
out:
|
||||||
return ERR_PTR(err);
|
return d_splice_alias(inode, dentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hostfs_link(struct dentry *to, struct inode *ino,
|
static int hostfs_link(struct dentry *to, struct inode *ino,
|
||||||
|
|
Loading…
Reference in New Issue