[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220429172711.GC174938@bgt-140510-bm01>
Date: Fri, 29 Apr 2022 17:27:11 +0000
From: Adam Manzanares <a.manzanares@...sung.com>
To: Pankaj Raghav <p.raghav@...sung.com>
CC: "jaegeuk@...nel.org" <jaegeuk@...nel.org>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"snitzer@...nel.org" <snitzer@...nel.org>,
"hch@....de" <hch@....de>, "mcgrof@...nel.org" <mcgrof@...nel.org>,
"naohiro.aota@....com" <naohiro.aota@....com>,
"sagi@...mberg.me" <sagi@...mberg.me>,
"damien.lemoal@...nsource.wdc.com" <damien.lemoal@...nsource.wdc.com>,
"dsterba@...e.com" <dsterba@...e.com>,
"johannes.thumshirn@....com" <johannes.thumshirn@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"clm@...com" <clm@...com>,
"gost.dev@...sung.com" <gost.dev@...sung.com>,
"chao@...nel.org" <chao@...nel.org>,
"linux-f2fs-devel@...ts.sourceforge.net"
<linux-f2fs-devel@...ts.sourceforge.net>,
"josef@...icpanda.com" <josef@...icpanda.com>,
"jonathan.derrick@...ux.dev" <jonathan.derrick@...ux.dev>,
"agk@...hat.com" <agk@...hat.com>,
"kbusch@...nel.org" <kbusch@...nel.org>,
"kch@...dia.com" <kch@...dia.com>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"dm-devel@...hat.com" <dm-devel@...hat.com>,
"bvanassche@....org" <bvanassche@....org>,
"jiangbo.365@...edance.com" <jiangbo.365@...edance.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"matias.bjorling@....com" <matias.bjorling@....com>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>
Subject: Re: [PATCH 06/16] nvmet: use blk_queue_zone_no()
On Wed, Apr 27, 2022 at 06:02:45PM +0200, Pankaj Raghav wrote:
> From: Luis Chamberlain <mcgrof@...nel.org>
>
> Instead of open coding the number of zones given a sector, use the helper
> blk_queue_zone_no(). This let's us make modifications to the math if
> needed in one place and adds now support for npo2 zone devices.
>
> Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
> Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
> ---
> drivers/nvme/target/zns.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
> index e34718b09550..e41b6a6ef048 100644
> --- a/drivers/nvme/target/zns.c
> +++ b/drivers/nvme/target/zns.c
> @@ -243,7 +243,7 @@ static unsigned long nvmet_req_nr_zones_from_slba(struct nvmet_req *req)
> unsigned int sect = nvmet_lba_to_sect(req->ns, req->cmd->zmr.slba);
>
> return blkdev_nr_zones(req->ns->bdev->bd_disk) -
> - (sect >> ilog2(bdev_zone_sectors(req->ns->bdev)));
> + bdev_zone_no(req->ns->bdev, sect);
> }
>
> static unsigned long get_nr_zones_from_buf(struct nvmet_req *req, u32 bufsize)
> --
> 2.25.1
>
Looks good.
Reviewed by: Adam Manzanares <a.manzanares@...sung.com>
Powered by blists - more mailing lists