diff options
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 92db9e94514..63adcb79298 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -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 |