Skip to content

Commit 5bf3544

Browse files
author
Al Viro
committed
sysv_lookup: use d_splice_alias()
code is simpler that way Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent b135dce commit 5bf3544

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

‎fs/sysv/namei.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,9 @@ static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, un
5151
if (dentry->d_name.len > SYSV_NAMELEN)
5252
return ERR_PTR(-ENAMETOOLONG);
5353
ino = sysv_inode_by_name(dentry);
54-
55-
if (ino) {
54+
if (ino)
5655
inode = sysv_iget(dir->i_sb, ino);
57-
if (IS_ERR(inode))
58-
return ERR_CAST(inode);
59-
}
60-
d_add(dentry, inode);
61-
return NULL;
56+
return d_splice_alias(inode, dentry);
6257
}
6358

6459
static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev)

0 commit comments

Comments
 (0)