Skip to content

Commit a596a23

Browse files
author
Al Viro
committed
bfs_lookup(): use d_splice_alias()
code is actually simpler that way. Acked-by: "Tigran A. Aivazian" <aivazian.tigran@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 837f3ec commit a596a23

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎fs/bfs/dir.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,9 @@ static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry,
141141
unsigned long ino = (unsigned long)le16_to_cpu(de->ino);
142142
brelse(bh);
143143
inode = bfs_iget(dir->i_sb, ino);
144-
if (IS_ERR(inode)) {
145-
mutex_unlock(&info->bfs_lock);
146-
return ERR_CAST(inode);
147-
}
148144
}
149145
mutex_unlock(&info->bfs_lock);
150-
d_add(dentry, inode);
151-
return NULL;
146+
return d_splice_alias(inode, dentry);
152147
}
153148

154149
static int bfs_link(struct dentry *old, struct inode *dir,

0 commit comments

Comments
 (0)