Skip to content

Commit

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

Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed May 22, 2018
1 parent b135dce commit 5bf3544
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions fs/sysv/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,9 @@ static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, un
if (dentry->d_name.len > SYSV_NAMELEN)
return ERR_PTR(-ENAMETOOLONG);
ino = sysv_inode_by_name(dentry);

if (ino) {
if (ino)
inode = sysv_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 sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev)
Expand Down

0 comments on commit 5bf3544

Please sign in to comment.