[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <83ef402e-1cff-a675-eab6-9fac9bb7565d@suse.de>
Date: Tue, 24 May 2022 09:14:11 +0200
From: Hannes Reinecke <hare@...e.de>
To: Pankaj Raghav <p.raghav@...sung.com>, axboe@...nel.dk, hch@....de,
snitzer@...hat.com, damien.lemoal@...nsource.wdc.com,
Johannes.Thumshirn@....com
Cc: linux-nvme@...ts.infradead.org, dm-devel@...hat.com,
dsterba@...e.com, jiangbo.365@...edance.com,
linux-kernel@...r.kernel.org, gost.dev@...sung.com,
linux-block@...r.kernel.org, jaegeuk@...nel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: Re: [PATCH v5 2/7] block: allow blk-zoned devices to have
non-power-of-2 zone size
On 5/24/22 09:10, Pankaj Raghav wrote:
> On 5/24/22 07:19, Hannes Reinecke wrote:
>
>>> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
>>> index c4e4c7071b7b..f5c7a41032ba 100644
>>> --- a/include/linux/blkdev.h
>>> +++ b/include/linux/blkdev.h
>>> @@ -676,6 +676,21 @@ static inline unsigned int
>>> blk_queue_zone_no(struct request_queue *q,
>>> return div64_u64(sector, zone_sectors);
>>> }
>>> +static inline bool blk_queue_is_zone_start(struct request_queue *q,
>>> sector_t sec)
>>> +{
>>> + sector_t zone_sectors = blk_queue_zone_sectors(q);
>>> + u64 remainder = 0;
>>> +
>>> + if (!blk_queue_is_zoned(q))
>>> + return false;
>>> +
>>
>> Not sure if we need this here; surely blk_queue_zone_sectors() will
>> already barf, and none of the callers did this check.
>>
> I totally agree with you but all the other blk_queue_* functions had
> this defensive check and I didn't want to break that pattern:
>
Ah, fair enough.
Reviewed-by: Hannes Reinecke <hare@...e.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
Powered by blists - more mailing lists