Skip to content

Commit b014951

Browse files
author
Al Viro
committed
minix_lookup: use d_splice_alias()
code is simpler that way Signed-off-by: Al Viro <[email protected]>
1 parent 72ff0b0 commit b014951

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

fs/minix/namei.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,9 @@ static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, un
2828
return ERR_PTR(-ENAMETOOLONG);
2929

3030
ino = minix_inode_by_name(dentry);
31-
if (ino) {
31+
if (ino)
3232
inode = minix_iget(dir->i_sb, ino);
33-
if (IS_ERR(inode))
34-
return ERR_CAST(inode);
35-
}
36-
d_add(dentry, inode);
37-
return NULL;
33+
return d_splice_alias(inode, dentry);
3834
}
3935

4036
static int minix_mknod(struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev)

0 commit comments

Comments
 (0)