Re: [dm-devel] [PATCH v9 05/13] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size

From: Pankaj Raghav
Date: Thu Aug 04 2022 - 03:30:01 EST


Hi Bart,

On 2022-08-03 19:22, Bart Van Assche wrote:
> On 8/3/22 02:47, Pankaj Raghav wrote:
>> -    sector &= ~(ns->zsze - 1);
>> +    /*
>> +     * Round down the sector value to the nearest zone start
>> +     */
>> +    div64_u64_rem(sector, ns->zsze, &remainder);
>> +    sector -= remainder;
>
> Could bdev_offset_from_zone_start() be used here?
>
We call this function during blk_revalidate_disk_zones() to evaluate the
chunk sectors. So we can't call bdev_offset_from_zone_start() from here
as the chunk_sectors will not be initialized yet :)