freevxfs_lookup(): use d_splice_alias()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 30 Apr 2018 23:20:00 +0000 (19:20 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 22 May 2018 18:27:51 +0000 (14:27 -0400)
code is simpler that way
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/freevxfs/vxfs_lookup.c

index ce4785fd81c63cd5f8f8a8fe12b7b5df73dcfc47..a51425634f6591767713d627563555ce68df160c 100644 (file)
@@ -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);
 }
 
 /**