Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4721088ioa; Wed, 27 Apr 2022 09:38:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDRf9Ku0xGKcchPcQQUYLJCOZMG/xifkONYylrfHe7l9QqJ95tiRHblcMum2mnSW3qplk4 X-Received: by 2002:aa7:8b0e:0:b0:50d:4310:c11f with SMTP id f14-20020aa78b0e000000b0050d4310c11fmr4674449pfd.49.1651077507901; Wed, 27 Apr 2022 09:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651077507; cv=none; d=google.com; s=arc-20160816; b=asqgxbvyN1FRSjxtHvv9Sl+dLEEZYoZYtlaL57n8IaX4OltTQeXSsOJc4fUO1fI0h9 GmhGNOFzQfafBHvkxZ4n3evebPFaRgDjalG3o7jauVmFfzvUB3g0b4Ynuy9XdvGPDMB+ ofHGEHwgtlWT2J/9uXEKxJz7U3931xByGeuv7VIkBEv7kO+IaLqbGifYuATHF3+YiJED ZKU3z/6AZM1Ah//wSUvvf1ZSy5tG0BzgvQJzEUPbEFycRhXCrx5bAuGsA/WBmIkp7c6K u8vJFkcm5NTcs1wczx9uUL4/H463xw5RpHHcfdpfHAbwPvrcLcRM1UKOp3SG5gUS5zVF gn+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=O6Jd6Tzouqxtj71a1kvN5ymqEncAInPsXdGxEKyRKOk=; b=0Q/ziSyR7d8tvJHhW2jMBfYyKZLAJiqHYkhR8YVJEp6AfG0G7Qsxwn0vZaVJ31z82F BJTIJIfLdCjqd5iVDZOnU7ikrZ1ucQ5zJj+DfjtdaRZdUpJakYHoIlyK0zBJkQuYoIWp I2wIskynoaHwaraxjdG8PE423h9jmMb42X5uftHQBwE8KbsLDb1yPKOIXcvvxyxPLo/3 viqeHP3Wz2mTQRF4ECVPKgasEIky+J19zos7l1Ub/1ZqUoe7yuKMD6IWoEDVd17oxYra l3u7qx1sbi5lRPCODhgdb6RZWM+pZCpPAcI21w/bzR9vYLjbghU+mEen7stLuxfPxwCQ 1Guw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=okYuDVNP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n19-20020a63a513000000b003816043ef39si2006559pgf.302.2022.04.27.09.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=okYuDVNP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D8213FC1F7; Wed, 27 Apr 2022 09:08:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241533AbiD0QH4 (ORCPT + 99 others); Wed, 27 Apr 2022 12:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241636AbiD0QGy (ORCPT ); Wed, 27 Apr 2022 12:06:54 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7193A3D1246 for ; Wed, 27 Apr 2022 09:03:13 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220427160304euoutp02e32bbcf154827bcddcc7409e4a6a9a1e~pzFCcIfRS1615616156euoutp02D for ; Wed, 27 Apr 2022 16:03:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220427160304euoutp02e32bbcf154827bcddcc7409e4a6a9a1e~pzFCcIfRS1615616156euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1651075385; bh=O6Jd6Tzouqxtj71a1kvN5ymqEncAInPsXdGxEKyRKOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=okYuDVNPLpKu25k82IIBR2oTDHR0888dZWh3c1jeYaTMFBDt2IO8QEVtCx3v2lDmK yfWMlDv9zYdpwoY4LLo0nkP7WjHCXvfZT3lcxai6MXVc7sk905ppJb+LUB/Tu73gZC bYIDJfbqunpzA60pr9KdNMuH19jY4npb3f1CnbpU= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220427160303eucas1p22d7897065d614fc598a2b9280bec4adb~pzFA9zWA62335623356eucas1p2b; Wed, 27 Apr 2022 16:03:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BE.04.09887.73969626; Wed, 27 Apr 2022 17:03:03 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220427160302eucas1p1aaba7a309778d3440c3315ad899e4035~pzFAbPWo12290322903eucas1p1u; Wed, 27 Apr 2022 16:03:02 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220427160302eusmtrp1f372a17275b8fcf9c53a511412b0283f~pzFAYod592077420774eusmtrp1N; Wed, 27 Apr 2022 16:03:02 +0000 (GMT) X-AuditID: cbfec7f4-45bff7000000269f-52-62696937cddc Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FF.97.09404.63969626; Wed, 27 Apr 2022 17:03:02 +0100 (BST) Received: from localhost (unknown [106.210.248.162]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220427160302eusmtip1f317e24df26397b4f560f917fa75f11b~pzE-yyoKH1317113171eusmtip1K; Wed, 27 Apr 2022 16:03:02 +0000 (GMT) From: Pankaj Raghav To: jaegeuk@kernel.org, axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, mcgrof@kernel.org, naohiro.aota@wdc.com, sagi@grimberg.me, damien.lemoal@opensource.wdc.com, dsterba@suse.com, johannes.thumshirn@wdc.com Cc: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, clm@fb.com, gost.dev@samsung.com, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, josef@toxicpanda.com, jonathan.derrick@linux.dev, agk@redhat.com, kbusch@kernel.org, kch@nvidia.com, linux-nvme@lists.infradead.org, dm-devel@redhat.com, bvanassche@acm.org, jiangbo.365@bytedance.com, linux-fsdevel@vger.kernel.org, matias.bjorling@wdc.com, linux-block@vger.kernel.org, Pankaj Raghav Subject: [PATCH 06/16] nvmet: use blk_queue_zone_no() Date: Wed, 27 Apr 2022 18:02:45 +0200 Message-Id: <20220427160255.300418-7-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427160255.300418-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUxTZxTG8957e++lse5aNL4ggqCOAY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G K3C1+c/PW6x+Rh5axbDhjLXQ1hzr5EN5l7WfRYu01XJO3u96W8Djr0Ixq6SQw6KXRu4sc15d Epx8WqbMgrnbMolX0OeAo1XJ7s95hcyTNl8IWJcsZtXfw1r+m2PzB4lzd2ev7WcK5jGI19nT xf1L+upsh3u2QlwT0uTO6/xcxJb/aYp0zxKp1W+fsLFPv7HzWvxjvX5zro85MWdVb+o1vXOt f9Kd/H3dElNB4cyy/WGy+hKfllx5NT0on0FWjFX+V6+Ewl+jI7NqjavYJ3VNXJyUadFqZqDs sXPKBsmt988Ur1ip9Fdo9RU7+16Gi61C0wrvBv5anWXTt9+17ZyIitD6L0zvSpVYijMSDbWY i4oTAU7HChCxAwAA X-CMS-MailID: 20220427160302eucas1p1aaba7a309778d3440c3315ad899e4035 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20220427160302eucas1p1aaba7a309778d3440c3315ad899e4035 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220427160302eucas1p1aaba7a309778d3440c3315ad899e4035 References: <20220427160255.300418-1-p.raghav@samsung.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luis Chamberlain 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 Signed-off-by: Pankaj Raghav --- 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