Skip to content

Commit

Permalink
minix_lookup: use d_splice_alias()
Browse files Browse the repository at this point in the history
code is simpler that way

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed May 22, 2018
1 parent 72ff0b0 commit b014951
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions fs/minix/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, un
return ERR_PTR(-ENAMETOOLONG);

ino = minix_inode_by_name(dentry);
if (ino) {
if (ino)
inode = minix_iget(dir->i_sb, ino);
if (IS_ERR(inode))
return ERR_CAST(inode);
}
d_add(dentry, inode);
return NULL;
return d_splice_alias(inode, dentry);
}

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

0 comments on commit b014951

Please sign in to comment.