Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1923342rwl; Thu, 30 Mar 2023 03:33:00 -0700 (PDT) X-Google-Smtp-Source: AKy350Y1r0B4f6DMizOOhD2OEnvVuYoFtxvmulSPqI8NHzKB4Sox28oXNcS/3ZqJ2Zh6ZlA9HUWk X-Received: by 2002:a17:902:da88:b0:19d:2a3:f019 with SMTP id j8-20020a170902da8800b0019d02a3f019mr1831479plx.1.1680172380618; Thu, 30 Mar 2023 03:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680172380; cv=none; d=google.com; s=arc-20160816; b=C0FKwOxZYOmp2xV5rxUbWjyKz9uifxpPM60lG2KCSUw2keB0KBL+H0RIBmAU3spOI5 wA5unSqGnlbN9VHhf9ZZCnHrSqZSNLHKyZnSu5G2J+y4pLM0FIP6tZ1/U9Ng8GCy21st hkwDTq9AMkkdA6YpzN2xjsOimE0dUfQcLbBnPVXddGBVGAy0tKTO85e/AFhguiffKhbz oTfI/T1BZz04F9RGlij/TeCRshQilvV45OuD7t8WrdnfpsEAggpqt1gqPpv+amaPs3Qk WYbTItJ9yW/yT04/xZHZWV2LNcSwyFQOBwEURJnzLQ+IkprTUBNQNxU7R3CR4CBJ37iR MK1g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eoJeiknRTpDZAZF33zT2p5PA1V+wX2CIb8shJ1yvL6A=; b=NFHDjW8cRZao5mEYy+UtTNzrT6Tw73aAbQzTFi6qg9lM23Eoc74a5rPv5lusvaGf+V zcoOhWrdVmTvVvl7Gf7rba1BdUn6HvBCzY97Ph8RIoLHdTdezVWK1UeYnUhNCJZdY8/q nIe6Wuw/HquntDf42zbGwa4TXhPYBHVSQDiVZWbTOhxV3Vru8f5BaWw3D13f0XLpxPuP Hlj9+nj2uCSHFu3yGMny6IMcKCeDqsLQo/qS61pnmvGKzlONpccV1/JeHRLHDUdRNIqN UOBdS3IX/5svHvAobMy/moLm03YqdDyXiH0c8SKOXA40f78P4CcHrDoSEqqFCzJvhsUZ r0ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linbit-com.20210112.gappssmtp.com header.s=20210112 header.b="A/tmhlvP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a170902db0700b001a11cf69a5csi1043532plx.612.2023.03.30.03.32.48; Thu, 30 Mar 2023 03:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linbit-com.20210112.gappssmtp.com header.s=20210112 header.b="A/tmhlvP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231341AbjC3K2F (ORCPT + 99 others); Thu, 30 Mar 2023 06:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231240AbjC3K1y (ORCPT ); Thu, 30 Mar 2023 06:27:54 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D521283E4 for ; Thu, 30 Mar 2023 03:27:52 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id r11so18517224wrr.12 for ; Thu, 30 Mar 2023 03:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linbit-com.20210112.gappssmtp.com; s=20210112; t=1680172071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eoJeiknRTpDZAZF33zT2p5PA1V+wX2CIb8shJ1yvL6A=; b=A/tmhlvPWF4xZ66HWcCboXl61FO7IevBvozsUg60oNkpXjuS3ZrLcsPEK8Wv4slWyW a8TG5HTpUh0P9CCf09By78KthLvs+A3FBtzf4HP2gtHwiteDRhfoMnZowLpdhyvjoqAM qRWRLCJNUZ7Yo6VYVJ+Ftq9BWqwusOWRMBdBj+6pxI1nctWZqYoLB7UJLbDGNNCMAfAb 0jFtKEWiM83z29KQCEbgrJY5VVYmX2KLfThltCB4xeJveLY+0TyD8zkob/n6K3DE11RB zknbsvrb2QnnXuO37jTbLh/EG7wY2dDm2I4PddYU1kz2V0w2gbqTjBjm+MR/gwtYsTut 9g7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680172071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eoJeiknRTpDZAZF33zT2p5PA1V+wX2CIb8shJ1yvL6A=; b=eH53Ga5k9l8+SBU4YAOQN29ZEw1Y2o+uDZc72kqC68+0XjQiBVd1SIqMbUt/7ZnaEX sY7pfKsh++QQRVStQC7AJUbQIc+YepRXh9zmZLwmeGbtv2dtEWzrO6KM9NVJ2aLgR9d0 sw8h6roFI+QoTz9LHfGMgTmq0gnBmoWqtY0M6SRq7aRuP1TzeaRSzN+myQB01tpbpfxS vlgzG1G8lBdOl2l6N7I4GUbuclqrWixIGR1mRKKcfxlqvhCkgyeZaai6lukPc3zi/+57 /K25IAe4fEKa1o3SclL/D0/rW3wZnvMYJPrYr6ZaRH0ISkRbTNcR3zxDsomMFurSOLdW Xsaw== X-Gm-Message-State: AAQBX9eE1zZpfZDCucUYGskU0iBItQ9aN/eh+8asxBh39OSAo9gnyJCG OqbSsJrJgccPUHId5H3D4OcpJQ== X-Received: by 2002:a5d:6585:0:b0:2c8:c667:1bb4 with SMTP id q5-20020a5d6585000000b002c8c6671bb4mr16886265wru.48.1680172071284; Thu, 30 Mar 2023 03:27:51 -0700 (PDT) Received: from localhost.localdomain (h082218028181.host.wavenet.at. [82.218.28.181]) by smtp.gmail.com with ESMTPSA id s11-20020adff80b000000b002d6f285c0a2sm26352514wrp.42.2023.03.30.03.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 03:27:50 -0700 (PDT) From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= To: Jens Axboe Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, Lars Ellenberg , Philipp Reisner , linux-block@vger.kernel.org, Andreas Gruenbacher , =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= Subject: [PATCH v3 4/7] drbd: INFO_bm_xfer_stats(): Pass a peer device argument Date: Thu, 30 Mar 2023 12:27:41 +0200 Message-Id: <20230330102744.2128122-5-christoph.boehmwalder@linbit.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230330102744.2128122-1-christoph.boehmwalder@linbit.com> References: <20230330102744.2128122-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_int.h | 4 ++-- drivers/block/drbd/drbd_main.c | 2 +- drivers/block/drbd/drbd_receiver.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 7bd10089bfc9..97c091990bf6 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -127,8 +127,8 @@ struct bm_xfer_ctx { unsigned bytes[2]; }; -extern void INFO_bm_xfer_stats(struct drbd_device *device, - const char *direction, struct bm_xfer_ctx *c); +extern void INFO_bm_xfer_stats(struct drbd_peer_device *peer_device, + const char *direction, struct bm_xfer_ctx *c); static inline void bm_xfer_ctx_bit_to_word_offset(struct bm_xfer_ctx *c) { diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 178a7ae40af8..6647f84f3879 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -1247,7 +1247,7 @@ send_bitmap_rle_or_plain(struct drbd_peer_device *peer_device, struct bm_xfer_ct } if (!err) { if (len == 0) { - INFO_bm_xfer_stats(device, "send", c); + INFO_bm_xfer_stats(peer_device, "send", c); return 0; } else return 1; diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index e70076fe1f2e..c6f93a9087b1 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -4766,11 +4766,11 @@ decode_bitmap_c(struct drbd_peer_device *peer_device, return -EIO; } -void INFO_bm_xfer_stats(struct drbd_device *device, +void INFO_bm_xfer_stats(struct drbd_peer_device *peer_device, const char *direction, struct bm_xfer_ctx *c) { /* what would it take to transfer it "plaintext" */ - unsigned int header_size = drbd_header_size(first_peer_device(device)->connection); + unsigned int header_size = drbd_header_size(peer_device->connection); unsigned int data_size = DRBD_SOCKET_BUFFER_SIZE - header_size; unsigned int plain = header_size * (DIV_ROUND_UP(c->bm_words, data_size) + 1) + @@ -4794,7 +4794,7 @@ void INFO_bm_xfer_stats(struct drbd_device *device, r = 1000; r = 1000 - r; - drbd_info(device, "%s bitmap stats [Bytes(packets)]: plain %u(%u), RLE %u(%u), " + drbd_info(peer_device, "%s bitmap stats [Bytes(packets)]: plain %u(%u), RLE %u(%u), " "total %u; compression: %u.%u%%\n", direction, c->bytes[1], c->packets[1], @@ -4872,7 +4872,7 @@ static int receive_bitmap(struct drbd_connection *connection, struct packet_info goto out; } - INFO_bm_xfer_stats(device, "receive", &c); + INFO_bm_xfer_stats(peer_device, "receive", &c); if (device->state.conn == C_WF_BITMAP_T) { enum drbd_state_rv rv; -- 2.39.2