]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/reiserfs/inode.c
[PATCH] switch all filesystems over to d_obtain_alias
[karo-tx-linux.git] / fs / reiserfs / inode.c
index 5699171212ae2d3d3428c3b23c42c604d56a26ab..6c4c2c69449f6bc74dddf5c42a0daea09ccf6adf 100644 (file)
@@ -1522,7 +1522,6 @@ static struct dentry *reiserfs_get_dentry(struct super_block *sb,
 
 {
        struct cpu_key key;
-       struct dentry *result;
        struct inode *inode;
 
        key.on_disk_key.k_objectid = objectid;
@@ -1535,16 +1534,8 @@ static struct dentry *reiserfs_get_dentry(struct super_block *sb,
                inode = NULL;
        }
        reiserfs_write_unlock(sb);
-       if (!inode)
-               inode = ERR_PTR(-ESTALE);
-       if (IS_ERR(inode))
-               return ERR_CAST(inode);
-       result = d_alloc_anon(inode);
-       if (!result) {
-               iput(inode);
-               return ERR_PTR(-ENOMEM);
-       }
-       return result;
+
+       return d_obtain_alias(inode);
 }
 
 struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid,