[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:
Christoph Hellwig
2008-08-11 15:49:04 +02:00
committed by Al Viro
parent 4ea3ada295
commit 440037287c
19 changed files with 78 additions and 305 deletions

View File

@ -1243,7 +1243,6 @@ end_rename:
static struct dentry *udf_get_parent(struct dentry *child)
{
struct dentry *parent;
struct inode *inode = NULL;
struct dentry dotdot;
struct fileIdentDesc cfi;
@ -1266,13 +1265,7 @@ static struct dentry *udf_get_parent(struct dentry *child)
goto out_unlock;
unlock_kernel();
parent = d_alloc_anon(inode);
if (!parent) {
iput(inode);
parent = ERR_PTR(-ENOMEM);
}
return parent;
return d_obtain_alias(inode);
out_unlock:
unlock_kernel();
return ERR_PTR(-EACCES);
@ -1283,7 +1276,6 @@ static struct dentry *udf_nfs_get_inode(struct super_block *sb, u32 block,
u16 partref, __u32 generation)
{
struct inode *inode;
struct dentry *result;
kernel_lb_addr loc;
if (block == 0)
@ -1300,12 +1292,7 @@ static struct dentry *udf_nfs_get_inode(struct super_block *sb, u32 block,
iput(inode);
return ERR_PTR(-ESTALE);
}
result = d_alloc_anon(inode);
if (!result) {
iput(inode);
return ERR_PTR(-ENOMEM);
}
return result;
return d_obtain_alias(inode);
}
static struct dentry *udf_fh_to_dentry(struct super_block *sb,