summaryrefslogtreecommitdiff
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-08-11 13:49:04 (GMT)
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-23 09:13:01 (GMT)
commit440037287c5ebb07033ab927ca16bb68c291d309 (patch)
treec4be3843ea87a777c2647f471895917005d8068f /fs/fuse/inode.c
parent4ea3ada2955e4519befa98ff55dd62d6dfbd1705 (diff)
downloadlinux-440037287c5ebb07033ab927ca16bb68c291d309.tar.xz
[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>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 54b1f0e..2e99f34 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -596,12 +596,8 @@ static struct dentry *fuse_get_dentry(struct super_block *sb,
if (inode->i_generation != handle->generation)
goto out_iput;
- entry = d_alloc_anon(inode);
- err = -ENOMEM;
- if (!entry)
- goto out_iput;
-
- if (get_node_id(inode) != FUSE_ROOT_ID) {
+ entry = d_obtain_alias(inode);
+ if (!IS_ERR(entry) && get_node_id(inode) != FUSE_ROOT_ID) {
entry->d_op = &fuse_dentry_operations;
fuse_invalidate_entry_cache(entry);
}
@@ -696,17 +692,14 @@ static struct dentry *fuse_get_parent(struct dentry *child)
name.name = "..";
err = fuse_lookup_name(child_inode->i_sb, get_node_id(child_inode),
&name, &outarg, &inode);
- if (err && err != -ENOENT)
+ if (err) {
+ if (err == -ENOENT)
+ return ERR_PTR(-ESTALE);
return ERR_PTR(err);
- if (err || !inode)
- return ERR_PTR(-ESTALE);
-
- parent = d_alloc_anon(inode);
- if (!parent) {
- iput(inode);
- return ERR_PTR(-ENOMEM);
}
- if (get_node_id(inode) != FUSE_ROOT_ID) {
+
+ parent = d_obtain_alias(inode);
+ if (!IS_ERR(parent) && get_node_id(inode) != FUSE_ROOT_ID) {
parent->d_op = &fuse_dentry_operations;
fuse_invalidate_entry_cache(parent);
}