From patchwork Wed Jun 15 10:19:17 2022
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pankaj Raghav
X-Patchwork-Id: 12882065
Return-Path:
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
by smtp.lore.kernel.org (Postfix) with ESMTP id 23310C43334
for ; Wed, 15 Jun 2022 10:20:53 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1347470AbiFOKUt (ORCPT );
Wed, 15 Jun 2022 06:20:49 -0400
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38210 "EHLO
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S1347656AbiFOKUO (ORCPT
);
Wed, 15 Jun 2022 06:20:14 -0400
Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com
[210.118.77.11])
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7AC4CD77
for ;
Wed, 15 Jun 2022 03:20:05 -0700 (PDT)
Received: from eucas1p2.samsung.com (unknown [182.198.249.207])
by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id
20220615102003euoutp0142f46c91c1edc91a69b9b94fcb1ad330~4xAiFW5_E2495924959euoutp01q
for ;
Wed, 15 Jun 2022 10:20:03 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com
20220615102003euoutp0142f46c91c1edc91a69b9b94fcb1ad330~4xAiFW5_E2495924959euoutp01q
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;
s=mail20170921; t=1655288403;
bh=unj+wNyhFPITbvGE3viUqmlATeoyeQTs0Irz7fIV/Z8=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=UMJYiM24f2u4jVZwawNifTPoHmhTa9Y0J6Go84LX1a2mFNaUH8hACFq34d7Vag0MT
7aYGDjgzHXcq424+zu3U8k7RrZT3gsjSJf5XRliwGzJLHuXchC3L4+TyNbYfugIRRw
jDgsI4tCscbr7QPUKAHtRlSJM+he+n4b0quEXOIQ=
Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by
eucas1p1.samsung.com (KnoxPortal) with ESMTP id
20220615102001eucas1p14900ffba109adf1d6ad58fb31b6d3662~4xAgLQcWb1438314383eucas1p1Q;
Wed, 15 Jun 2022 10:20:01 +0000 (GMT)
Received: from eucas1p1.samsung.com ( [182.198.249.206]) by
eusmges2new.samsung.com (EUCPMTA) with SMTP id 0F.77.10067.152B9A26;
Wed, 15
Jun 2022 11:20:01 +0100 (BST)
Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by
eucas1p2.samsung.com (KnoxPortal) with ESMTPA id
20220615102000eucas1p27720aaa3c309327b2b9a33c5f840f498~4xAfSu7uw2162921629eucas1p2v;
Wed, 15 Jun 2022 10:20:00 +0000 (GMT)
Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by
eusmtrp2.samsung.com (KnoxPortal) with ESMTP id
20220615102000eusmtrp2756cf6a4b8bd2122ff7819f99032710c~4xAfRraCL0349503495eusmtrp2N;
Wed, 15 Jun 2022 10:20:00 +0000 (GMT)
X-AuditID: cbfec7f4-dc1ff70000002753-ba-62a9b251a009
Received: from eusmtip1.samsung.com ( [203.254.199.221]) by
eusmgms2.samsung.com (EUCPMTA) with SMTP id EF.24.09038.052B9A26;
Wed, 15
Jun 2022 11:20:00 +0100 (BST)
Received: from localhost (unknown [106.210.248.244]) by eusmtip1.samsung.com
(KnoxPortal) with ESMTPA id
20220615101959eusmtip1f228020010ced5b70c8bfdd433177605~4xAd8XbKh1152711527eusmtip1L;
Wed, 15 Jun 2022 10:19:59 +0000 (GMT)
From: Pankaj Raghav
To: hch@lst.de, snitzer@redhat.com, damien.lemoal@opensource.wdc.com,
axboe@kernel.dk
Cc: bvanassche@acm.org, linux-kernel@vger.kernel.org,
jiangbo.365@bytedance.com, hare@suse.de, pankydev8@gmail.com,
dm-devel@redhat.com, jonathan.derrick@linux.dev,
gost.dev@samsung.com, dsterba@suse.com, jaegeuk@kernel.org,
linux-nvme@lists.infradead.org, Johannes.Thumshirn@wdc.com,
linux-block@vger.kernel.org, Pankaj Raghav ,
Luis Chamberlain
Subject: [PATCH v7 10/13] dm-table: use bdev_is_zone_start helper in
device_area_is_invalid()
Date: Wed, 15 Jun 2022 12:19:17 +0200
Message-Id: <20220615101920.329421-11-p.raghav@samsung.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20220615101920.329421-1-p.raghav@samsung.com>
MIME-Version: 1.0
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFvrJKsWRmVeSWpSXmKPExsWy7djPc7qBm1YmGfzar2ux+m4/m8W0Dz+Z
LX6fPc9ssffdbFaLCz8amSxuHtjJZLFn0SQmi5WrjzJZPFk/i9mi58AHFou/XfeAYi0PgYpv
aVtc3jWHzWL+sqfsFjcmPGW0+Ly0hd1izc2nLBZtG78yOgh7XL7i7fHvxBo2j52z7rJ7XD5b
6rFpVSebx8KGqcwem5fUe+y+2QCUa73P6vF+31U2j74tqxg91m+5yuKx+XS1x+dNch7tB7qZ
AvijuGxSUnMyy1KL9O0SuDLmNpxjL3jKVXGzbRlrA+Nlji5GTg4JAROJ6w/XsnUxcnEICaxg
lFj+/BWU84VRYsXlDiYI5zOjxORZXcwwLV0vu5khEssZJXpvfoSqesko8ePfTqAMBwebgJZE
Yyc7SIOIQLjE0T33mEBsZoE+ZoknL+tAbGGBeIlf61+CDWURUJX43XqfDcTmFbCWmHF0BjvE
MnmJmZe+g9mcQPEds3tYIWoEJU7OfMICMVNeonnrbLCDJATOcUps3buGFaLZRWJz/xZGCFtY
4tXxLVBDZST+75zPBGFXSzy98RuquYVRon/nejaQBySAtvWdyQExmQU0Jdbv0ocod5Q42r+H
BaKCT+LGW0GIE/gkJm2bzgwR5pXoaBOCqFa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nuwGmaBBcwSp+9MAEsIC8RKzN1/GGwo
i4CqxO/W+2wgNq+AtcSMozPYIRbIS8y89B3M5gSK75jdwwoyX0jASmLXu3iIckGJkzOfsIDY
zEDlzVtnM09gFJiFJDULSWoBI9MqRpHU0uLc9NxiI73ixNzi0rx0veT83E2MwCjfduznlh2M
K1991DvEyMTBeIhRgoNZSYTXLHhlkhBvSmJlVWpRfnxRaU5q8SFGU6CzJzJLiSbnA9NMXkm8
oZmBqaGJmaWBqaWZsZI4r2dBR6KQQHpiSWp2ampBahFMHxMHp1QDU8yDuaePFx5PLf7yYZ2m
rdW2UIOnbKVf/nyvkHAXOcU652TvFIfAtkaD6HAPvw/c03zzdy+s077Dd+DMYtNSY9uZ5w3F
V01plll91rF354KuK1bn2qL37Dtw4RNf1K7LptMVlGMDy4N5pGKEpJ5NX5PpclO1/vLlE3tt
p3z/svZxveS6rw4Tm3RWHjPYUnntUFL/mS9OIjGTls5qMP/duEE3cWN4uOgJhh/JwiKJPIrH
pN4JXOJc0CG05w774omn57zOjnrnsbzJbUIO+41ZNzqSmZ+eyMxizhJwll1rUVAg4mOxWzbw
ZM2d1slW0X/3z0xfoiF1YF760Ygr0nJZkyTSHkzhVzVZJbz0lZ6HjxJLcUaioRZzUXEiAHgN
WCd7AwAA
X-CMS-MailID: 20220615102000eucas1p27720aaa3c309327b2b9a33c5f840f498
X-Msg-Generator: CA
X-RootMTR: 20220615102000eucas1p27720aaa3c309327b2b9a33c5f840f498
X-EPHeader: CA
CMS-TYPE: 201P
X-CMS-RootMailID: 20220615102000eucas1p27720aaa3c309327b2b9a33c5f840f498
References: <20220615101920.329421-1-p.raghav@samsung.com>
Precedence: bulk
List-ID:
X-Mailing-List: linux-block@vger.kernel.org
Use bdev_is_zone_start() helper that uses generic calculation to check
for zone alignment instead of using po2 based alignment check.
Signed-off-by: Pankaj Raghav
Reviewed-by: Luis Chamberlain
---
drivers/md/dm-table.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index bd539afbf..b553cdb6d 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -251,7 +251,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
if (bdev_is_zoned(bdev)) {
unsigned int zone_sectors = bdev_zone_sectors(bdev);
- if (start & (zone_sectors - 1)) {
+ if (blk_queue_is_zone_start(bdev_get_queue(bdev), start)) {
DMWARN("%s: start=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)start,
@@ -268,7 +268,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
* devices do not end up with a smaller zone in the middle of
* the sector range.
*/
- if (len & (zone_sectors - 1)) {
+ if (blk_queue_is_zone_start(bdev_get_queue(bdev), len)) {
DMWARN("%s: len=%llu not aligned to h/w zone size %u of %pg",
dm_device_name(ti->table->md),
(unsigned long long)len,