Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2175297iof; Tue, 7 Jun 2022 22:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPDJcfZmFNmlukQeRffH+X12agXvQ1g5vezMh0wl3Uz9YqNEU3snvV4BEJfMl6Yw/hKNoa X-Received: by 2002:a17:903:41cc:b0:166:3ce2:9bdd with SMTP id u12-20020a17090341cc00b001663ce29bddmr31821861ple.21.1654665182327; Tue, 07 Jun 2022 22:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654665182; cv=none; d=google.com; s=arc-20160816; b=neK3X2xGhV1ZxdY4fvpWNo0+YU4/LNLF+qxLhFn2e+XFDK124xX8tiDFPY/+K0DT9R 9Dqlc5BNmYNRnF7GzJS1rlSW2Uw6dj2bnVPovnbCHQ2dKk1YAgHkzkRM/wRMCr6L3EIM ahgCuvF4BnIg0zkC9w29G+38rGFR0Gu/f69WR4Z9oNLKwdeOkTR0WuB/2N47fCRVZuSY KpzvEfgwt5sU8Ryg2lVe7SJT94E3mbycazbeGKjkKvllERq9mmsuYD6WKErWU/N/ikRm RaOhdh0XOxnmQSels/Mksrg71TgLmG9p5MlYKXq8+rv+3T4JoGz/m4ppyjRbDPiiiRZr oDoQ== 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=0jKmNftECU9X+H2zRr2sQZBlBz36gNuF8vhOJ8jnjjU=; b=qT0/txB/pNpuLIT4Ul+mFU9DaKs34h2MQHuONCG9nAkQvqMUTdhGqQ5jq0mPKUYjn9 +gPu1qigdVDR1WqcTylSQvqegRghahItK/t4dH8LLeKkbOAGRktUFEswf9XxkBRXt3u9 cdnJM+/nP4yMNQok4R+IPePSa2VMe77m4dcr2qWoq9UBGahqEHslYtfd2OCBjTTuOaas e6K87qKlcF46BvHNzPKAQmM10SXPHtsYztaqHQzDszWh2IkDlt5wxNQ+3Ue5dZDfU2Ri Y5+dLk1sFWp+RT8nXhQgsgrfF8TSi1vGfzw+qsdobCWwerWs2A6/12aZocnNf2xY+3WE h5ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=igNZIWgu; 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 o6-20020a170902d4c600b0016759c39ce7si18979179plg.204.2022.06.07.22.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:13:02 -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=igNZIWgu; 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 82D2540E727; Tue, 7 Jun 2022 21:43:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383825AbiFGWfc (ORCPT + 99 others); Tue, 7 Jun 2022 18:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378061AbiFGVX2 (ORCPT ); Tue, 7 Jun 2022 17:23:28 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC2122656D; Tue, 7 Jun 2022 12:00:32 -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 sin.source.kernel.org (Postfix) with ESMTPS id F2831CE247D; Tue, 7 Jun 2022 19:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07E54C385A2; Tue, 7 Jun 2022 19:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628407; bh=UTY8+CWf3iUGuxPq73YCDs1bTopBciGq/1mh/lyokrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=igNZIWgu5+V7A/RvihW/tszUTLf3yDgs9HQGHGAYdrANb7tek3sSvsQBaE0tGR9Dh PIkQnyrDC2iKW6d5RR/zI90Gx3eN6gNkyNX278objqRaPW9THCQHS9SuC/SDJNsNbf Yhz3Je5eRmjUHuFWIFf3wEkUeSmlcAzhMVrh7ypY= 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 317/879] drbd: remove assign_p_sizes_qlim Date: Tue, 7 Jun 2022 18:57:15 +0200 Message-Id: <20220607165012.051709794@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 40349d0e16cedd0de561f59752c3249780fb749b ] Fold each branch into its only caller. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220415045258.199825-5-hch@lst.de Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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 4b0b25cc916e..367715205c86 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) -- 2.35.1