]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/namei.c
ext4: remove unused variable in ext4_get_parent
[linux-2.6-omap-h63xx.git] / fs / ext4 / namei.c
index 92db9e94514779dce3d0cdccdcc78bc4e12ea465..63adcb792988016d642a6e341bcbca2f694b68d1 100644 (file)
@@ -1061,7 +1061,6 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru
 struct dentry *ext4_get_parent(struct dentry *child)
 {
        unsigned long ino;
-       struct dentry *parent;
        struct inode *inode;
        static const struct qstr dotdot = {
                .name = "..",
@@ -1083,16 +1082,7 @@ struct dentry *ext4_get_parent(struct dentry *child)
                return ERR_PTR(-EIO);
        }
 
-       inode = ext4_iget(child->d_inode->i_sb, ino);
-       if (IS_ERR(inode))
-               return ERR_CAST(inode);
-
-       parent = d_alloc_anon(inode);
-       if (!parent) {
-               iput(inode);
-               parent = ERR_PTR(-ENOMEM);
-       }
-       return parent;
+       return d_obtain_alias(ext4_iget(child->d_inode->i_sb, ino));
 }
 
 #define S_SHIFT 12