[PATCH] switch all filesystems over to d_obtain_alias
Switch all users of d_alloc_anon to d_obtain_alias. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:

committed by
Al Viro

parent
4ea3ada295
commit
440037287c
@@ -112,35 +112,14 @@ struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid,
|
||||
|
||||
struct dentry *efs_get_parent(struct dentry *child)
|
||||
{
|
||||
struct dentry *parent;
|
||||
struct inode *inode;
|
||||
struct dentry *parent = ERR_PTR(-ENOENT);
|
||||
efs_ino_t ino;
|
||||
long error;
|
||||
|
||||
lock_kernel();
|
||||
|
||||
error = -ENOENT;
|
||||
ino = efs_find_entry(child->d_inode, "..", 2);
|
||||
if (!ino)
|
||||
goto fail;
|
||||
|
||||
inode = efs_iget(child->d_inode->i_sb, ino);
|
||||
if (IS_ERR(inode)) {
|
||||
error = PTR_ERR(inode);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = -ENOMEM;
|
||||
parent = d_alloc_anon(inode);
|
||||
if (!parent)
|
||||
goto fail_iput;
|
||||
|
||||
if (ino)
|
||||
parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino));
|
||||
unlock_kernel();
|
||||
|
||||
return parent;
|
||||
|
||||
fail_iput:
|
||||
iput(inode);
|
||||
fail:
|
||||
unlock_kernel();
|
||||
return ERR_PTR(error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user