diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-30 20:09:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-22 14:27:53 -0400 |
commit | 5bf3544970eb23a6470fe97c7cc37246509277e2 (patch) | |
tree | 9dfb199b6775b03995fc8e0d1ba898328f268c00 /fs/sysv/namei.c | |
parent | b135dcea37d1506332796a6ff48fc30be7c5e384 (diff) |
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>
Diffstat (limited to 'fs/sysv/namei.c')
-rw-r--r-- | fs/sysv/namei.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index 250b0755b908..4d5d20491ffd 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c | |||
@@ -51,14 +51,9 @@ static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, un | |||
51 | if (dentry->d_name.len > SYSV_NAMELEN) | 51 | if (dentry->d_name.len > SYSV_NAMELEN) |
52 | return ERR_PTR(-ENAMETOOLONG); | 52 | return ERR_PTR(-ENAMETOOLONG); |
53 | ino = sysv_inode_by_name(dentry); | 53 | ino = sysv_inode_by_name(dentry); |
54 | 54 | if (ino) | |
55 | if (ino) { | ||
56 | inode = sysv_iget(dir->i_sb, ino); | 55 | inode = sysv_iget(dir->i_sb, ino); |
57 | if (IS_ERR(inode)) | 56 | return d_splice_alias(inode, dentry); |
58 | return ERR_CAST(inode); | ||
59 | } | ||
60 | d_add(dentry, inode); | ||
61 | return NULL; | ||
62 | } | 57 | } |
63 | 58 | ||
64 | static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev) | 59 | static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev) |