Skip to content

Commit

Permalink
btrfs: lift make_bad_inode into btrfs_iget
Browse files Browse the repository at this point in the history
We don't need to check is_bad_inode() after the call of
btrfs_read_locked_inode() - it's exactly the same as checking return
value for being non-zero.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: David Sterba <dsterba@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Al Viro authored and kdave committed Aug 6, 2018
1 parent 8d9e220 commit 9bc2cef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3771,7 +3771,6 @@ static int btrfs_read_locked_inode(struct inode *inode)

make_bad:
btrfs_free_path(path);
make_bad_inode(inode);
return ret;
}

Expand Down Expand Up @@ -5697,12 +5696,13 @@ struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
int ret;

ret = btrfs_read_locked_inode(inode);
if (!is_bad_inode(inode)) {
if (!ret) {
inode_tree_add(inode);
unlock_new_inode(inode);
if (new)
*new = 1;
} else {
make_bad_inode(inode);
unlock_new_inode(inode);
iput(inode);
ASSERT(ret < 0);
Expand Down

0 comments on commit 9bc2cef

Please sign in to comment.