From patchwork Wed Apr 27 15:36:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 8959271 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17D01BF29F for ; Wed, 27 Apr 2016 15:37:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D3F720259 for ; Wed, 27 Apr 2016 15:37:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB11420272 for ; Wed, 27 Apr 2016 15:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753455AbcD0Pgr (ORCPT ); Wed, 27 Apr 2016 11:36:47 -0400 Received: from mx144.netapp.com ([216.240.21.25]:13162 "EHLO mx144.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbcD0Pgq (ORCPT ); Wed, 27 Apr 2016 11:36:46 -0400 X-IronPort-AV: E=Sophos;i="5.24,542,1455004800"; d="scan'208";a="113019627" Received: from vmwexchts02-prd.hq.netapp.com ([10.122.105.23]) by mx144-out.netapp.com with ESMTP; 27 Apr 2016 08:36:42 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS02-PRD.hq.netapp.com (10.122.105.23) with Microsoft SMTP Server id 15.0.1156.6; Wed, 27 Apr 2016 08:36:37 -0700 Received: from localhost.localdomain (andros-new.vpn.netapp.com [10.55.74.31]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id u3RFaXwa014459; Wed, 27 Apr 2016 08:36:40 -0700 (PDT) From: To: CC: , , Andy Adamson Subject: [PATCH Version 3 9/9] NFS add multiaddr to nfs_show_nfsv4_options Date: Wed, 27 Apr 2016 11:36:10 -0400 Message-ID: <1461771370-16375-10-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1461771370-16375-1-git-send-email-andros@netapp.com> References: <1461771370-16375-1-git-send-email-andros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Adamson Signed-off-by: Andy Adamson --- fs/nfs/super.c | 24 ++++++++++++++++++++++++ net/sunrpc/xprtmultipath.c | 1 + 2 files changed, 25 insertions(+) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 70a4fda..1dc1e18 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -605,8 +605,32 @@ static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss, int showdefaults) { struct nfs_client *clp = nfss->nfs_client; + struct rpc_clnt *clnt = clp->cl_rpcclient; + struct rpc_xprt_switch *xps; + struct rpc_xprt *pos; + unsigned int nxprts; seq_printf(m, ",clientaddr=%s", clp->cl_ipaddr); + rcu_read_lock(); + xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch)); + pos = xprt_iter_xprt(&clnt->cl_xpi); + if (xps == NULL || pos == NULL) + return; + nxprts = xps->xps_nxprts; + list_for_each_entry_rcu(pos, &xps->xps_xprt_list, xprt_switch) { + if (nxprts == 0) + break; + if (pos->address_strings[RPC_DISPLAY_ADDR] == NULL) + break; + /* Do not display mount xprt as a multiaddr */ + if (pos == rcu_access_pointer(clp->cl_rpcclient->cl_xprt)) + continue; + seq_printf(m, ",multiaddr=%s", + pos->address_strings[RPC_DISPLAY_ADDR]); + nxprts--; + } + rcu_read_unlock(); + xprt_switch_put(xps); } #else static void nfs_show_nfsv4_options(struct seq_file *m, struct nfs_server *nfss, diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c index 360f64c..708c22a 100644 --- a/net/sunrpc/xprtmultipath.c +++ b/net/sunrpc/xprtmultipath.c @@ -403,6 +403,7 @@ struct rpc_xprt *xprt_iter_xprt(struct rpc_xprt_iter *xpi) WARN_ON_ONCE(!rcu_read_lock_held()); return xprt_iter_ops(xpi)->xpi_xprt(xpi); } +EXPORT_SYMBOL_GPL(xprt_iter_xprt); static struct rpc_xprt *xprt_iter_get_helper(struct rpc_xprt_iter *xpi,