diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-04-30 19:18:26 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-22 14:27:51 -0400 |
commit | d023b3a19fd5e9d3955b02581a4ca479c6bcef6e (patch) | |
tree | 6c618e7012655f58a0aba25bc4eee661558a8d59 /fs/cramfs/inode.c | |
parent | b455ecd4bb4db1419c45139535fc931572177882 (diff) |
cramfs_lookup(): use d_splice_alias()
simpler code that way, actually
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cramfs/inode.c')
-rw-r--r-- | fs/cramfs/inode.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 124b093d14e5..c4fb9ad7c808 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -808,10 +808,7 @@ static struct dentry *cramfs_lookup(struct inode *dir, struct dentry *dentry, un } out: mutex_unlock(&read_mutex); - if (IS_ERR(inode)) - return ERR_CAST(inode); - d_add(dentry, inode); - return NULL; + return d_splice_alias(inode, dentry); } static int cramfs_readpage(struct file *file, struct page *page) |