From: Al Viro Date: Mon, 30 Apr 2018 23:20:00 +0000 (-0400) Subject: freevxfs_lookup(): use d_splice_alias() X-Git-Tag: v4.18-rc1~179^2~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72ff0b038de27118a95a3c4c4d4a2126902899c6;p=thirdparty%2Flinux.git freevxfs_lookup(): use d_splice_alias() code is simpler that way Cc: Christoph Hellwig Signed-off-by: Al Viro --- diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c index ce4785fd81c63..a51425634f659 100644 --- a/fs/freevxfs/vxfs_lookup.c +++ b/fs/freevxfs/vxfs_lookup.c @@ -193,13 +193,9 @@ vxfs_lookup(struct inode *dip, struct dentry *dp, unsigned int flags) return ERR_PTR(-ENAMETOOLONG); ino = vxfs_inode_by_name(dip, dp); - if (ino) { + if (ino) ip = vxfs_iget(dip->i_sb, ino); - if (IS_ERR(ip)) - return ERR_CAST(ip); - } - d_add(dp, ip); - return NULL; + return d_splice_alias(ip, dp); } /**