From patchwork Sat Apr 9 04:50:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12807588 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 aib29ajc249.phx1.oracleemaildelivery.com (aib29ajc249.phx1.oracleemaildelivery.com [192.29.103.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2698CC4167B for ; Sat, 9 Apr 2022 04:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=EkSJDYyYx8a/NRzo/14pMQysZsuLHG2hkmLaNuLG1j8=; b=PNLVsgWfgHlItUn+Na889p6n8WKupsthXvHssguA39rHjFP5Z5MXRWziXTbMfTR2NnO6XNcds/2R YS9qLOjeOG+Ihio/DNeqzoYungffKQSgTeQIfEKRYvbuo69wzREcGV6MSWmx0FMDOsntDIoNCK0t GGRBrlWT/qr6A95WwQOO0Or1Op9SE9cxnYB6i/gxdxYMV4KvPe0fyAITI79taNi1n8Hg/yYmphI4 k2x0g1njRDZ63k2BDQidj3MaQpnuPC5fAhthTJlzdRVBz0bpsBqau8dyxwAgwqAXpD4ZgERFitjt o+xNAkLVD3QSutjDeUrxH5LpLduqKHBCUDvbIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=EkSJDYyYx8a/NRzo/14pMQysZsuLHG2hkmLaNuLG1j8=; b=Nzd/RM+fmj2noFcGa30VeOJLEmfYPzSqch8ELgXfrR5S4E+OQEd1hSRNT4uwEeDo3kcj/0llIHUw uDT/f4GC+0KJzI3kjQfr7GwQIPUkCRUZi5FFtBEMid6CZ/Rxetscu9MBS9MzJ8tXSzdFrFsORysE VuUMY4ddXIubPFGnqg5SHEU0Ugj5z5O0XdZgWhH1hqZqsUc1CksEdGHrpVV6NCzjD15TdFvTb3yE NatbM6RNK+EwSttYl4k4+GxjO1mXKt310ua3HP0cq8T2kOz3COhTG9CioUGUstIO+H/v4HKde37M hTITb/qHM5x4SpcHs1dNJmgEHzyHcLmW+f+kOg== Received: by omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220319 64bit (built Mar 19 2022)) with ESMTPS id <0RA200GXX2U9ZW80@omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Sat, 09 Apr 2022 04:51:45 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=o0hivJC1zBmf2OLswEv2WeM9LwYiU39b8DIC3mFzVkc=; b=3F4Gy8p9Tvq+5pylL46uvOJn7h o2XZpRogXFQL3VJFZPE+ZZDtjrf9Pc2OTl5fZtGSYd57hTdFlYXIdIHOqaBXa/gwwIgNeTwpzh8E1 QxRCn+KG2Muq11G9sBZPqcFJsQdF+RO1A1/vOYvAkvrZpiLwvpNlQupw5qXMvPBGR692SLA9Gc4O9 +WQuMA5xQqJyH9AX6svLk38kVSqqX8kZssANUh1VF1n2HxXeQbt2B929yqhRSjrF5mSUtQQl9u3kF pbbIDtUGIe8ib42MP8DoNYMKEID8G4oja6vJ3M+Cjui+ZmorwUZF4pyM0UDyDdlGBMS8H8gcMK1Fa XnV5hFlQ==; To: Jens Axboe Date: Sat, 9 Apr 2022 06:50:21 +0200 Message-id: <20220409045043.23593-6-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220409045043.23593-1-hch@lst.de> References: <20220409045043.23593-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10311 signatures=695566 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 impostorscore=0 suspectscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=692 spamscore=0 clxscore=242 mlxscore=0 phishscore=0 priorityscore=30 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204090027 Cc: jfs-discussion@lists.sourceforge.net, linux-nvme@lists.infradead.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, dm-devel@redhat.com, target-devel@vger.kernel.org, linux-mtd@lists.infradead.org, drbd-dev@lists.linbit.com, linux-s390@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org, cluster-devel@redhat.com, xen-devel@lists.xenproject.org, linux-ext4@vger.kernel.org, linux-um@lists.infradead.org, nbd@other.debian.org, linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, ceph-devel@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, =?utf-8?q?Christoph_B=C3=B6hmwalder?= , ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, linux-btrfs@vger.kernel.org Subject: [Ocfs2-devel] [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="utf-8" Content-transfer-encoding: base64 Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-ORIG-GUID: qp4U3aeOksBvCZ_m7jMjICNBIPfcS6mJ X-Proofpoint-GUID: qp4U3aeOksBvCZ_m7jMjICNBIPfcS6mJ Reporting-Meta: AAEAPRp9bfLwGO8Km1YOhVianYhtyr2O5X+kom1udep1rTb/nxeO6UXNICCfXHk/ iIJ4P4GYPeEcY9Cn+VCLxc8YOpR9d/m0Q0toQS0kV2BsXolQaVZ0aLmVbPGUHTDP 3hgKACGEkwmngACU3pBNJRyTFq72/wm0yROZrpK31fdO5k1H0W0LXDNjVIbUovJ2 FxpfECI2yhKRBRDlcJAgOabKU8sohWoUUiFlXzMDInnz755hqOtwDkXE+DGAC1Bk Oo5vKSsB/0h7FQhmPWRO+fG2Pap4/dqDNvB4YuBRibW44osW8MCSw/24o1Pr+5mu Vr4c9ZnXckNzcVI5Mc4Em/hNJxzpfpJ/eYyeUj+foF2jHJHagc7CdCh42AfuYKgs PRdkF4BLBY2zorBBGg2I9QDNSeCeRBRYoQ8GE+fUMxPDVTqJlcaiO+Vlus680sV3 1pxR53utXVr9m7zZ+DQA7P3g47d5lu8bGR83IstHQKTWfxiGEW/kxAys4zUU58Eo EjZPqQcxt8PrEVW584Nmgc8cPvGsuWR2TuG6N+U0TRGS Use the bdev based limits helpers where they exist. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 1262fe1c33618..aa2c21aeb747c 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu memset(p, 0, packet_size); if (get_ldev_if_state(device, D_NEGOTIATING)) { - struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev); + struct block_device *bdev = device->ldev->backing_bdev; + struct request_queue *q = bdev_get_queue(bdev); + d_size = drbd_get_max_capacity(device->ldev); rcu_read_lock(); u_size = rcu_dereference(device->ldev->disk_conf)->disk_size; @@ -933,13 +935,13 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu max_bio_size = queue_max_hw_sectors(q) << 9; max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE); p->qlim->physical_block_size = - cpu_to_be32(queue_physical_block_size(q)); + cpu_to_be32(bdev_physical_block_size(bdev)); p->qlim->logical_block_size = - cpu_to_be32(queue_logical_block_size(q)); + cpu_to_be32(bdev_logical_block_size(bdev)); p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q)); - p->qlim->io_min = cpu_to_be32(queue_io_min(q)); - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q)); + p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev)); + p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev)); p->qlim->discard_enabled = blk_queue_discard(q); put_ldev(device); } else {