From patchwork Fri Apr 15 04:52:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12814503 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 aib29ajc248.phx1.oracleemaildelivery.com (aib29ajc248.phx1.oracleemaildelivery.com [192.29.103.248]) (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 7F55AC43219 for ; Fri, 15 Apr 2022 04:54:28 +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=9aFNLPpHQPJMK4gUBYGABn0jc4VVctpHVtKjtyXjbfQ=; b=vai+WrpEUuHoc9VQlSNoDrcdYFRKR11wMHF4JhF+carewrH07RmchmBQdJ2KpOwDkmoQwEH0mF5g LQ1LF82t6zRCFCGwDxorMdrptBJv1loLrY4frnZT07cYUDTHUw+3sS4vMyiaXarwiRkOPvxeoQO4 5sdYYhJ3LVbOqkafJDg20QXHOC669lkBYq16zX67rlbmmM1PUBjvWYfofe4c09EMGN/qXIPEKw5T +Uf+QEO+z4l55mPs3b3pMnSwEqT2F4TdpTwS1XG3NPkiJ82HaPvlWZ6jf9QR273GZ/TE/GGALL1g zott9YpH4xiSJxu4S2NP2cBAcUjKYSt9DDOsDA== 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=9aFNLPpHQPJMK4gUBYGABn0jc4VVctpHVtKjtyXjbfQ=; b=VVlf8MBjwyalPYSOpoiClNUeXSNLVCJ1QOucz5SvfyJi/qaJmxX0LpZkEVfC/c+StjIalkpAjx4q AGj5sFGIVNRorr/T6EKJbnvhHu3JGPwamoeVItc3piXXLniE8y8YzgbF+QXHJpO7K3Z8+4H4YJLG bjrMEU9izQZd8Qv7en5wnsbosE+rw6EPrOX6l3VqDVkv2d7QoaO1ZzJjDMORADwEoDUNh2molT72 dvAHuKeoqV0nUKaJ9naKAyFZbcem+UXgJ+bhi7lqrwf2HFRzl+N0X2D+MpCS1SMYa7rBHKJRIqDZ VgtiE+BJH4aR7etfEQ/yM2ImYEk5Fh89oaah0w== Received: by omta-ad2-fd1-201-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20220319 64bit (built Mar 19 2022)) with ESMTPS id <0RAD003EK6YR2JF0@omta-ad2-fd1-201-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Fri, 15 Apr 2022 04:54:27 +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=be5XRqr6FpD/xPCRROQj1WW79ZNoTG4VrTyORPZGjVE=; b=zfdoWKjLNg8/93VMXMR/8dmem+ WdvS+5iIu6uir1zneoGsW/PVn5k5msDFRP3cNUjzgk48HwXHEWdbPPQegdyt6x56ivnd6KhVFEdRn raW2CONj2YH3bKud1GU1IPcR9v/j6pw0pUmG9drywqIdz4cTw9frqxiK8uJ0qudjT7ff4EmR2zNpd iXKlU7IflKK7BZ1vMlEvBpbCIpEVLMDJnliSIXYAubrng3TWL7OH99pGfDALzISzxUUJefgBXG3V5 WlBB+jh7r7m3TcfVeysrxVV3wHeAvYOUUoaQFeOXr6OBj0iU6tL7PMj+sYlQjUaSSJXCl4UqBVXnS NdWcSxoQ==; To: Jens Axboe Date: Fri, 15 Apr 2022 06:52:35 +0200 Message-id: <20220415045258.199825-5-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-reply-to: <20220415045258.199825-1-hch@lst.de> References: <20220415045258.199825-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10317 signatures=695566 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 priorityscore=0 mlxscore=0 malwarescore=0 mlxlogscore=833 bulkscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 clxscore=248 adultscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204150029 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 04/27] drbd: remove assign_p_sizes_qlim 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: i2ks-dtXBEYIMoCesOOg3_DnuoEiwR7i X-Proofpoint-GUID: i2ks-dtXBEYIMoCesOOg3_DnuoEiwR7i Reporting-Meta: AAGpG2Pbt6cSMX70OK/oCNRuGX548w49FuR1fDTZ8/km8ktUIqMB0LbJZhmhew7m F7qIUq6Gie3uYMx88wKMoiXVv2zoXqQErGd30thJP70ZxI2FqcTJHw841Jwkph3K 9YBaPZrtlMfkMhoWLe96paK0yDU00m+w1O7h8/Dy8WHS57tHdDDSd4KTLYngTrUB XwX9jINh3B6NVt+cpGkjKupZXPnWrBmrhkzuPoogC0ponDP4rH7v89YZN7O6f2jy w6fLBIfQG0OdQ2F9PEhIPhXMyWjKnlOFinWEplKlXt1kgqLw/XrkVUccjYNKcmgr Zn9O8ic5g0nhKm7ElmxY+diWncySVAuac5247FKZjSALBU11KOpRjnTaw5q1Fe6/ b5vj+j4475/ulP4UxZlpORmVd2K7hJ47GYlDqX2im4gMf3t/pabiJypoJJMtdqwX qd/oLv285aR7t5NFhhOLk6rO1v+LqgRjvJYEG3iCACS380mwzRpp2tJwaaV4ZYck PabI2t8IDoQQsCHvJwo7ST27MbnWpQQV7Mkpmllry4lm Fold each branch into its only caller. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_main.c | 47 +++++++++++++++------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 4b0b25cc916ee..367715205c860 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device) } } -/* communicated if (agreed_features & DRBD_FF_WSAME) */ -static void -assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p, - struct request_queue *q) -{ - if (q) { - p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q)); - p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q)); - 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->discard_enabled = blk_queue_discard(q); - p->qlim->write_same_capable = 0; - } else { - q = device->rq_queue; - p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q)); - p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q)); - p->qlim->alignment_offset = 0; - p->qlim->io_min = cpu_to_be32(queue_io_min(q)); - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q)); - p->qlim->discard_enabled = 0; - p->qlim->write_same_capable = 0; - } -} - int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags) { struct drbd_device *device = peer_device->device; @@ -957,14 +932,32 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu q_order_type = drbd_queue_order_type(device); max_bio_size = queue_max_hw_sectors(q) << 9; max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE); - assign_p_sizes_qlim(device, p, q); + p->qlim->physical_block_size = + cpu_to_be32(queue_physical_block_size(q)); + p->qlim->logical_block_size = + cpu_to_be32(queue_logical_block_size(q)); + 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->discard_enabled = blk_queue_discard(q); put_ldev(device); } else { + struct request_queue *q = device->rq_queue; + + p->qlim->physical_block_size = + cpu_to_be32(queue_physical_block_size(q)); + p->qlim->logical_block_size = + cpu_to_be32(queue_logical_block_size(q)); + p->qlim->alignment_offset = 0; + p->qlim->io_min = cpu_to_be32(queue_io_min(q)); + p->qlim->io_opt = cpu_to_be32(queue_io_opt(q)); + p->qlim->discard_enabled = 0; + d_size = 0; u_size = 0; q_order_type = QUEUE_ORDERED_NONE; max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */ - assign_p_sizes_qlim(device, p, NULL); } if (peer_device->connection->agreed_pro_version <= 94)