Re: [PATCH v2 3/3] btrfs: zoned: factor out zoned device lookup
From: Johannes Thumshirn <hidden>
Date: 2021-05-25 09:11:30
From: Johannes Thumshirn <hidden>
Date: 2021-05-25 09:11:30
On 24/05/2021 12:01, Qu Wenruo wrote:
quoted
if (use_append) { - struct extent_map *em; - struct map_lookup *map; - struct block_device *bdev; + struct btrfs_device *device; - em = btrfs_get_chunk_map(fs_info, disk_start, PAGE_SIZE); - if (IS_ERR(em)) { + device = btrfs_zoned_get_device(fs_info, disk_start, PAGE_SIZE);Not sure if it's too late, but I find that all callers are just passing PAGE_SIZE (to be more accurate, should be sectorsize) to btrfs_zoned_get_device(). Do we really need that @length parameter anyway? Since we're just using one sector to grab the chunk map, the @length parameter is completely useless and we can grab sectorsize using fs_info. This makes me to dig deeper than needed every time I see such length usage...
Hm yes I think you're right. I'll send a cleanup soon.