Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp829866rwl; Thu, 10 Aug 2023 02:10:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVsRCsjeiN8zDN6vHnfdeOavq4zavPs8NatRLWhIw0pYBTNqCoFf7Oy6rCG3Q+/wd5rjJG X-Received: by 2002:a05:6830:1dae:b0:6b9:b1a7:1f92 with SMTP id z14-20020a0568301dae00b006b9b1a71f92mr1961460oti.8.1691658641617; Thu, 10 Aug 2023 02:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691658641; cv=none; d=google.com; s=arc-20160816; b=MfYUMwnVG0oXlmMPyvROg4A1LYNYp4crEvqSUOQ5Q0BknhBSiRR5LdIJN0gKBsnKQ0 ik5oYuu57EK/R1Ahn/Oau51w9SWPCb64Ym4D83KQ/aqxI2YK2Wv2D2/aXY03uElrOsh8 Koze2KZMbdj4qhIWZeFoG4XY1WN+5JmeONGHU4VVRIYYmrPhXBOKATy2yEJVqcsLlcUw 1qIIIEXcm1S4YTnxJce1gzzfbe9lpF1IBL7gZxZNyiIYn0pM7AkIxk8A4lLgrnliws06 uwGCiy5cV3QqqCrHf/O+7y2wk6pQ9niLWIrGQx7o6zhkYxugZsFCZuaNqM6ChlSCrco1 ywmA== 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=k1oR0AGiMsWk7trnzBFjc68bzXkNBgyLs5IFhE/m2V4=; fh=w1PxD+AzYA9rTV2sSsX3uNw7+F67Zm5UlgOEJowej+A=; b=L7qbXsdda8IqiIlUKNEBZgqYSW4p9gemi6xbrs4azd7Y0JH2yEmQrC3jJbkHcxKs1Q F5aafbMxxrKPW2qmDgzM2UJOEeAx0JuxyrmgRJDuEhppzx60aVwoZUU61c4yUOVu3n5q Hk6EvYVPlrXbfo2adIFCjN13NyxKrKV2JkBvoN1sX6+LRJgx3Gq8SzNYI8uAcYlnXJDw sKKPSxHy5TjZeXI6ZfQYyfGp5VGj69ry47kXeHiStsiOZpJcN/Lnh8AlNmidsaVrl2Gw xk80fo1v1dtTQurVHPrkbNAHG9u9hrquzaj0+JmByblLbTCqSDqLRVm/wNa1S8gyZN+w AtLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F7VOk1uU; 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 t10-20020a65608a000000b005638183ab90si1187964pgu.611.2023.08.10.02.10.28; Thu, 10 Aug 2023 02:10:41 -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=F7VOk1uU; 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 S233698AbjHJIjy (ORCPT + 99 others); Thu, 10 Aug 2023 04:39:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbjHJIjx (ORCPT ); Thu, 10 Aug 2023 04:39:53 -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 6E9FADC for ; Thu, 10 Aug 2023 01:39:53 -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 038AC6539E for ; Thu, 10 Aug 2023 08:39:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED789C433C7; Thu, 10 Aug 2023 08:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691656792; bh=PXPoMFrsgAFHqr/4bBZEHHWbQsM7B4gZYjh1x02b02s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F7VOk1uUKx7+Rp0Y0e8XmFaLr70dY7eOeFytnzUXwn97eEixhdLtnXZmIDwDNN5sS Wxg+6AMz9QJKJ4z2ZuQ1stdnWGnH2pLpEn7YTZhpr+2mjXSB0bYRWVrPTCTSiAmKQM p0lCtTxJgwqSDu8qg33byifae/5Wvn4qybNNgcrYRr9F6sDHctmPYMWRHxcHhIisiz +GcQ+LcsyJiEBqdsKtQsSAxS8KPgGXCWoE5Jxm4rRDs8SY/dc3pBdpXKa57YRy6aES HHDzvkA3ElmWGrV2SEDgFGjDNaJFXykKO9+WIcCSNwAiJS7EYntiM+/Jk8L8kHYBOx jdLS80TsWnjTQ== 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 v6 1/3] SUNRPC: add verbose parameter to __svc_print_addr() Date: Thu, 10 Aug 2023 10:39:19 +0200 Message-ID: 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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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. Reviewed-by: NeilBrown Reviewed-by: Jeff Layton 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 fa55d12dc765..2615cc535199 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h @@ -213,21 +213,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%hu", &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%hu", &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 d3280ae70e36..940be13d02b0 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