[PATCH] switch all filesystems over to d_obtain_alias
[pandora-kernel.git] / fs / efs / namei.c
index 291abb1..c3fb5f9 100644 (file)
@@ -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);
+       return parent;
 }