Skip to content

Commit

Permalink
bfs_lookup(): use d_splice_alias()
Browse files Browse the repository at this point in the history
code is actually simpler that way.

Acked-by: "Tigran A. Aivazian" <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed May 22, 2018
1 parent 837f3ec commit a596a23
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions fs/bfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,9 @@ static struct dentry *bfs_lookup(struct inode *dir, struct dentry *dentry,
unsigned long ino = (unsigned long)le16_to_cpu(de->ino);
brelse(bh);
inode = bfs_iget(dir->i_sb, ino);
if (IS_ERR(inode)) {
mutex_unlock(&info->bfs_lock);
return ERR_CAST(inode);
}
}
mutex_unlock(&info->bfs_lock);
d_add(dentry, inode);
return NULL;
return d_splice_alias(inode, dentry);
}

static int bfs_link(struct dentry *old, struct inode *dir,
Expand Down

0 comments on commit a596a23

Please sign in to comment.