Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1627846rwb; Fri, 28 Jul 2023 12:16:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlEeelPFOYRK2Aig9t6NmOmCS28wEeSn7y46RVZrPRo2vEVHu8MdRte3Gs8yZXTuN9AVaqJF X-Received: by 2002:a05:6a20:2455:b0:137:a3c9:aaa9 with SMTP id t21-20020a056a20245500b00137a3c9aaa9mr2828288pzc.16.1690571808267; Fri, 28 Jul 2023 12:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690571808; cv=none; d=google.com; s=arc-20160816; b=UwHtQca72pwfJ+PXjgwcavsEQLQoI/PsDVoJYetQ0P6jTrW3ZWSmn+1XdzMXvHWhxL 3qt6nmqTGtTo9oLjpQHN9aktwIgFoFsixfE0dDOQgNyYW1YVNXWnUJhPsx9La7FvTYhi Soodg5i0nf7Ukbm71GGzMx8TqCjIrvSrRFG+UsqnROgscR5V63WDYu/EK0zg5QM/GPqi K/NeWYOo7+fSBjmN+Nbl6SORMsAIKGG5dktPDO3+spzNAhVQ7qF4mBw4//tbjRi1QEUY QdFBZDFQYXTxyHA/dSk7Jm14rBcRpqg9KqGeXIRtRfe3vS3UmXAKlP2Ql3fKa44RD1Ik 8mbA== 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=70xLfoQYqgjj1AT1IVBur1U8PlWZ5yyccjdGt1b2Iw8=; fh=w1PxD+AzYA9rTV2sSsX3uNw7+F67Zm5UlgOEJowej+A=; b=AfeT95mWEeoeSb9U/hpxV1Te4IjZWQgEaScR87UMn66Yr9M3s8GEI2mYUmLozJ3Ixm NSxOL/SGX5z2zuOejPN/2oy4DpcQh0jK3Il0LPc0lUZTLy+ooCo3k1kPI+QY7EO/Gi7y oiJUvjnugTtRMamvEhKuY0NYGKmbQQ3WFp7FAN/SykTwArkW32l90ZeWvjjICQPBtKuy FVKm2eP4AX4HkfQ3ddqMpOJkDn/x5nmqjjK4csVrv+zbZ9nSGYYcHqZFlaZPK4Sbdg5g Wkme4Sizx2/KdndYs0WybEwNekcfWEHhuiC7Zxi9t7g3BcbADDumJXIvBrWpVFHf3Zx1 q4+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KfzSSgCk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be3-20020a656e43000000b0053ee9b21820si970624pgb.72.2023.07.28.12.16.36; Fri, 28 Jul 2023 12:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@kernel.org header.s=k20201202 header.b=KfzSSgCk; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbjG1Soc (ORCPT + 99 others); Fri, 28 Jul 2023 14:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233196AbjG1SoZ (ORCPT ); Fri, 28 Jul 2023 14:44:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5506448A for ; Fri, 28 Jul 2023 11:44:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C4259621DB for ; Fri, 28 Jul 2023 18:44:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D498CC433C7; Fri, 28 Jul 2023 18:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690569860; bh=wq0RwmZyh8d7P+LT8f7g7J1NGNRywalsthOqIRbZ7MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KfzSSgCk7XgNf4pGOOGmBBmqe9jh/BYl/5YoOmWORuRGSM3giGU0opT45uSUzzJE3 UpdjyHCaN7+k6BZ9+NzLuNL4zW3ZkZc8zwpCL5Ebbsl3w8syFtJAC5ixDRQkBpDnkM VgU1XIzLeb09Jsmt98Qat4eX/A0SN4cdkKHSdEdplJCmfesyFqd+OYeIOj1xrG6TQH P+ntWzeWjk08EBu3jkUXBaoCyRLojhQdeeA4fbA++fYMg4Dqyj9GCV5lqWYLEa51Wi oqVrDgz23jngaITQ+yjNs6HCTlu++ihXCFVe+Lb8w1Aqfab2UQ/xaZCPhk0pBg7YwH gZeJUo6MLARcA== From: Lorenzo Bianconi To: linux-nfs@vger.kernel.org Cc: lorenzo.bianconi@redhat.com, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de Subject: [PATCH v4 1/2] SUNRPC: add verbose parameter to __svc_print_addr() Date: Fri, 28 Jul 2023 20:44:03 +0200 Message-ID: <5b0eff4e3ef9bf9621f5095189933f60def40f0d.1690569488.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-nfs@vger.kernel.org Introduce verbose parameter to utility routine in order to reduce output verbosity. This is a preliminary patch to add rpc_status entry in nfsd debug filesystem in order to dump pending RPC requests debugging information. Signed-off-by: Lorenzo Bianconi --- include/linux/sunrpc/svc_xprt.h | 12 ++++++------ net/sunrpc/svc_xprt.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index a6b12631db21..1715d4c6bd6b 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h @@ -209,21 +209,21 @@ static inline unsigned short svc_xprt_remote_port(const struct svc_xprt *xprt) } static inline char *__svc_print_addr(const struct sockaddr *addr, - char *buf, const size_t len) + char *buf, const size_t len, + bool verbose) { const struct sockaddr_in *sin = (const struct sockaddr_in *)addr; const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)addr; switch (addr->sa_family) { case AF_INET: - snprintf(buf, len, "%pI4, port=%u", &sin->sin_addr, - ntohs(sin->sin_port)); + snprintf(buf, len, "%pI4, %s%u", &sin->sin_addr, + verbose ? "port=" : "", ntohs(sin->sin_port)); break; case AF_INET6: - snprintf(buf, len, "%pI6, port=%u", - &sin6->sin6_addr, - ntohs(sin6->sin6_port)); + snprintf(buf, len, "%pI6, %s%u", &sin6->sin6_addr, + verbose ? "port=" : "", ntohs(sin6->sin6_port)); break; default: diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 62c7919ea610..16b794d291a4 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -386,7 +386,7 @@ EXPORT_SYMBOL_GPL(svc_xprt_copy_addrs); */ char *svc_print_addr(struct svc_rqst *rqstp, char *buf, size_t len) { - return __svc_print_addr(svc_addr(rqstp), buf, len); + return __svc_print_addr(svc_addr(rqstp), buf, len, true); } EXPORT_SYMBOL_GPL(svc_print_addr); -- 2.41.0