Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2183423iof; Tue, 7 Jun 2022 22:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn+6ZN305rimrmRrXp/I6k7vRluLyqqcaUw9P3deSm91Ay01dQfylE3uYtUdnNoSrv33x0 X-Received: by 2002:a63:fb13:0:b0:3fc:3b53:37a9 with SMTP id o19-20020a63fb13000000b003fc3b5337a9mr28965123pgh.430.1654666090334; Tue, 07 Jun 2022 22:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666090; cv=none; d=google.com; s=arc-20160816; b=VG7FSZogU9QCfaF43lmYyQUDrn1wrv0TuDPUJPPMOP2VKG9N4sWEYPsG34G4X+VI+z zSg4qQLxGYlG61tK5hmve8oWyynBf6cDFlxp1DEoq0N11zB3HecW1cyS9xGRGAieLrmu NTHclCsGuV/J4Bfu69+qSCwQiTU3mFGc87wTUvwa8WImUQoGIKx0PLkhW39I3+PiGEKa h7M5UCv0DJIq7m0hQrX7lQp1ArYKJUXZllFzHUDgr8afWdHHmEmXICenOcR5RuKyqeZr mvemqLfFbCKP16aCuCFBd7GrBmHmvNYn102DBLAb2AVi15S+tItD8QlcXuHdEjv5vt3j z69A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5ZO+6OeAaYTfpdsrFcOZI7AU5uxyOKi8omn8uHAHjpk=; b=u+cstuJzeuEFNJOc+wCob75xGs6TX4Z+RN9yFZ9YGXN1Fng/7Qh6x0Cc6PU7p4IWn2 yAz+siTTWYHzfd1kOaPWYJ3VlvHjxGg+xJTOAo7iDSWWPlU50V6zJwsdSrJwcVoCY0/V Uveb9lzkjZUFchKS8W9Ry6r9ETgq046SbD/NFX+XFdzvXEeVjOnPnlizOYmCnWzUurIE YaWnV+a9CGoLhDmeF3j+r78W9wP0t4F30jdpLai1MdP2KMrBZEemv8WW8Ed7xOHjPjjf wzoJ7bOp7DnvJojiOpfUi767heHzPk7lRUsBZ5x2HlRsksK4GU0ct9UuEFxwV7RD5wmo 38KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xXiJJUoL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d16-20020a63d710000000b003c5e1870574si26531581pgg.667.2022.06.07.22.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:28:10 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xXiJJUoL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D977647B49D; Tue, 7 Jun 2022 21:54:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384147AbiFGWfs (ORCPT + 99 others); Tue, 7 Jun 2022 18:35:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379003AbiFGVXQ (ORCPT ); Tue, 7 Jun 2022 17:23:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58C3C226CC2; Tue, 7 Jun 2022 12:00:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4F93DB8239F; Tue, 7 Jun 2022 19:00:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6E04C385A2; Tue, 7 Jun 2022 19:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628410; bh=TPRFP2xRp1bygFJ1WXucBwWn0OwIarywpK7WnUbnKmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xXiJJUoLOyasTStMHctpWBorn+Ys1hW0EUDX3IJpWEtzseyLNWNpH3mY2sNVwFPuH vv5/y2uBa9me+Hrw9HGVJJGfGa4DPXlPP2kZNtIMHQR0o6PWkUWQtX64PcOnqHBbi9 OHFt3PQrHMRqpaYDNc73RsX48NS89C6hpUh117G4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= , Jens Axboe , Sasha Levin Subject: [PATCH 5.18 318/879] drbd: use bdev based limit helpers in drbd_send_sizes Date: Tue, 7 Jun 2022 18:57:16 +0200 Message-Id: <20220607165012.080830401@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 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,T_SCC_BODY_TEXT_LINE 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: Christoph Hellwig [ Upstream commit 7a38acce229685968b770d1d9e64e01396b93643 ] Use the bdev based limits helpers where they exist. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220415045258.199825-6-hch@lst.de Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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 367715205c86..c39b04bda261 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 { -- 2.35.1