Commit 0aac4bce authored by David Howells's avatar David Howells Committed by Al Viro

afs: Show all of a server's addresses in /proc/fs/afs/servers

Show all of a server's addresses in /proc/fs/afs/servers, placing the
second plus addresses on padded lines of their own.  The current address is
marked with a star.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent b6cfbeca
...@@ -326,6 +326,7 @@ static int afs_proc_servers_show(struct seq_file *m, void *v) ...@@ -326,6 +326,7 @@ static int afs_proc_servers_show(struct seq_file *m, void *v)
{ {
struct afs_server *server; struct afs_server *server;
struct afs_addr_list *alist; struct afs_addr_list *alist;
int i;
if (v == SEQ_START_TOKEN) { if (v == SEQ_START_TOKEN) {
seq_puts(m, "UUID USE ADDR\n"); seq_puts(m, "UUID USE ADDR\n");
...@@ -334,10 +335,15 @@ static int afs_proc_servers_show(struct seq_file *m, void *v) ...@@ -334,10 +335,15 @@ static int afs_proc_servers_show(struct seq_file *m, void *v)
server = list_entry(v, struct afs_server, proc_link); server = list_entry(v, struct afs_server, proc_link);
alist = rcu_dereference(server->addresses); alist = rcu_dereference(server->addresses);
seq_printf(m, "%pU %3d %pISp\n", seq_printf(m, "%pU %3d %pISpc%s\n",
&server->uuid, &server->uuid,
atomic_read(&server->usage), atomic_read(&server->usage),
&alist->addrs[alist->index].transport); &alist->addrs[0].transport,
alist->index == 0 ? "*" : "");
for (i = 1; i < alist->nr_addrs; i++)
seq_printf(m, " %pISpc%s\n",
&alist->addrs[i].transport,
alist->index == i ? "*" : "");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment