[PATCH v4 05/13] btrfs: zoned: Cache superblock location in btrfs_zoned_device_info

Pankaj Raghav p.raghav at samsung.com
Tue May 17 00:55:37 PDT 2022


On 2022-05-16 23:58, David Sterba wrote:
>> Reviewed-by: Luis Chamberlain <mcgrof at kernel.org>
>> Signed-off-by: Pankaj Raghav <p.raghav at samsung.com>
>> ---
>>  fs/btrfs/zoned.c | 13 +++++++++----
>>  fs/btrfs/zoned.h |  1 +
>>  2 files changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
>> index 06f22c021..e8c7cebb2 100644
>> --- a/fs/btrfs/zoned.c
>> +++ b/fs/btrfs/zoned.c
>> @@ -511,6 +511,11 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
>>  			   max_active_zones - nactive);
>>  	}
>>  
>> +	/* Cache the sb zone number */
>> +	for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; ++i) {
>> +		zone_info->sb_zone_location[i] =
>> +			sb_zone_number(zone_info->zone_size_shift, i);
>> +	}
> 
> I don't think we need to cache the value right now, it's not in any hot
> path and call to bdev_zone_no is relatively cheap (only dereferencing a
> few pointers, all in-memory values).
Ok. I will fix it up in the next revision! Thanks.



More information about the Linux-nvme mailing list