linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 09/13] NFS: Add replica servers to volumes proc file.
Date: Mon, 30 Jan 2012 13:29:51 -0600	[thread overview]
Message-ID: <1327951795-16400-10-git-send-email-malahal@us.ibm.com> (raw)
In-Reply-To: <1327951795-16400-1-git-send-email-malahal@us.ibm.com>

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
---
 fs/nfs/client.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 54de25a..000ebdb 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1997,10 +1997,12 @@ static int nfs_volume_list_show(struct seq_file *m, void *v)
 	struct nfs_server *server;
 	struct nfs_client *clp;
 	char dev[8], fsid[17];
+	char *p, *end, replicas[256];
+	int i;
 
 	/* display header on line 1 */
 	if (v == &nfs_volume_list) {
-		seq_puts(m, "NV SERVER   PORT DEV     FSID              FSC\n");
+		seq_puts(m, "NV SERVER   PORT DEV     FSID              FSC REPLICAS\n");
 		return 0;
 	}
 	/* display one transport per line on subsequent lines */
@@ -2014,14 +2016,22 @@ static int nfs_volume_list_show(struct seq_file *m, void *v)
 		 (unsigned long long) server->fsid.major,
 		 (unsigned long long) server->fsid.minor);
 
+	p = replicas;
+	end = replicas + sizeof(replicas);
+	strncpy(replicas, "none", sizeof(replicas));
+	for (i = 0; i < NFS_MAX_REPLI_SERVERS && p < end; i++)
+		if (server->repli_servers[i])
+			p += snprintf(p, end - p, "%s/", server->repli_servers[i]);
+
 	rcu_read_lock();
-	seq_printf(m, "v%u %s %s %-7s %-17s %s\n",
+	seq_printf(m, "v%u %s %s %-7s %-17s %s %s\n",
 		   clp->rpc_ops->version,
 		   rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR),
 		   rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_PORT),
 		   dev,
 		   fsid,
-		   nfs_server_fscache_state(server));
+		   nfs_server_fscache_state(server),
+		   replicas);
 	rcu_read_unlock();
 
 	return 0;
-- 
1.7.8.3


  parent reply	other threads:[~2012-01-30 19:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 19:29 [RFC] [PATCH 00/13] NFS4 replication support Malahal Naineni
2012-01-30 19:29 ` [PATCH 01/13] SUNRPC: Allow temporary blocking of an rpc client Malahal Naineni
2012-01-30 19:29 ` [PATCH 02/13] SUNRPC: Use RCU to dereference the rpc_clnt.cl_xprt field Malahal Naineni
2012-01-30 19:29 ` [PATCH 03/13] SUNRPC: Move clnt->cl_server into struct rpc_xprt Malahal Naineni
2012-01-30 19:29 ` [PATCH 04/13] SUNRPC: Add a helper to switch the transport of the rpc_client Malahal Naineni
2012-01-30 19:29 ` [PATCH 05/13] SUNRPC: Add API to acquire source address Malahal Naineni
2012-01-30 19:29 ` [PATCH 06/13] NFS: Add an API for cloning an nfs_client Malahal Naineni
2012-01-30 19:29 ` [PATCH 07/13] NFS: Save root file handle in nfs_server Malahal Naineni
2012-01-30 19:29 ` [PATCH 08/13] NFS: Store server locations for replication Malahal Naineni
2012-01-30 19:29 ` Malahal Naineni [this message]
2012-01-30 19:29 ` [PATCH 10/13] NFS: Add replace transport infrastructure " Malahal Naineni
2012-01-30 19:29 ` [PATCH 11/13] NFS: Add replication capability to state manager thread Malahal Naineni
2012-01-30 19:29 ` [PATCH 12/13] NFS: Handle replication on a timeout error Malahal Naineni
2012-01-30 19:29 ` [PATCH 13/13] NFS: Avoid spurious replication recoveries Malahal Naineni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327951795-16400-10-git-send-email-malahal@us.ibm.com \
    --to=malahal@us.ibm.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).