mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
b135dcea37
commit
5bf3544970
1 changed files with 2 additions and 7 deletions
|
@ -51,14 +51,9 @@ static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry, un
|
||||||
if (dentry->d_name.len > SYSV_NAMELEN)
|
if (dentry->d_name.len > SYSV_NAMELEN)
|
||||||
return ERR_PTR(-ENAMETOOLONG);
|
return ERR_PTR(-ENAMETOOLONG);
|
||||||
ino = sysv_inode_by_name(dentry);
|
ino = sysv_inode_by_name(dentry);
|
||||||
|
if (ino)
|
||||||
if (ino) {
|
|
||||||
inode = sysv_iget(dir->i_sb, ino);
|
inode = sysv_iget(dir->i_sb, ino);
|
||||||
if (IS_ERR(inode))
|
return d_splice_alias(inode, dentry);
|
||||||
return ERR_CAST(inode);
|
|
||||||
}
|
|
||||||
d_add(dentry, inode);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev)
|
static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue