btrfs: factor out reading of bg from find_frist_block_group
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 2 Jun 2020 10:05:57 +0000 (19:05 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:20 +0000 (12:55 +0200)
commite3ba67a108ff5a2657990014d3ed4488bd665be6
tree21fce13358e04de172d199c0637c99ab281ab688
parent89d7da9bc592aa6a341d00f2d949615a89bb1eb7
btrfs: factor out reading of bg from find_frist_block_group

When find_first_block_group() finds a block group item in the extent-tree,
it does a lookup of the object in the extent mapping tree and does further
checks on the item.

Factor out this step from find_first_block_group() so we can further
simplify the code.

While we're at it, we can also just return early in
find_first_block_group(), if the tree slot isn't found.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c