btrfs: zoned: simplify btrfs_check_meta_write_pointer
btrfs_check_meta_write_pointer() will always be called with a NULL 'cache_ret' argument. As there's no need to check if we have a valid block_group passed in remove these checks. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
869f4cdc73
commit
8fdf54fe69
|
@ -1637,19 +1637,10 @@ bool btrfs_check_meta_write_pointer(struct btrfs_fs_info *fs_info,
|
|||
if (!btrfs_is_zoned(fs_info))
|
||||
return true;
|
||||
|
||||
cache = *cache_ret;
|
||||
|
||||
if (cache && (eb->start < cache->start ||
|
||||
cache->start + cache->length <= eb->start)) {
|
||||
btrfs_put_block_group(cache);
|
||||
cache = NULL;
|
||||
*cache_ret = NULL;
|
||||
}
|
||||
|
||||
if (!cache)
|
||||
cache = btrfs_lookup_block_group(fs_info, eb->start);
|
||||
if (!cache)
|
||||
return true;
|
||||
|
||||
if (cache) {
|
||||
if (cache->meta_write_pointer != eb->start) {
|
||||
btrfs_put_block_group(cache);
|
||||
cache = NULL;
|
||||
|
@ -1659,7 +1650,6 @@ bool btrfs_check_meta_write_pointer(struct btrfs_fs_info *fs_info,
|
|||
}
|
||||
|
||||
*cache_ret = cache;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue