提交 8fdf54fe 编写于 作者: J Johannes Thumshirn 提交者: David Sterba

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: NJosef Bacik <josef@toxicpanda.com>
Signed-off-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 869f4cdc
......@@ -1637,29 +1637,19 @@ bool btrfs_check_meta_write_pointer(struct btrfs_fs_info *fs_info,
if (!btrfs_is_zoned(fs_info))
return true;
cache = *cache_ret;
cache = btrfs_lookup_block_group(fs_info, eb->start);
if (!cache)
return true;
if (cache && (eb->start < cache->start ||
cache->start + cache->length <= eb->start)) {
if (cache->meta_write_pointer != eb->start) {
btrfs_put_block_group(cache);
cache = NULL;
*cache_ret = NULL;
ret = false;
} else {
cache->meta_write_pointer = eb->start + eb->len;
}
if (!cache)
cache = btrfs_lookup_block_group(fs_info, eb->start);
if (cache) {
if (cache->meta_write_pointer != eb->start) {
btrfs_put_block_group(cache);
cache = NULL;
ret = false;
} else {
cache->meta_write_pointer = eb->start + eb->len;
}
*cache_ret = cache;
}
*cache_ret = cache;
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册