diff options
author | David Howells <dhowells@redhat.com> | 2018-06-02 22:20:31 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-06-15 00:52:59 -0400 |
commit | 0aac4bce4b49e58c43181d293da491cd2bdba6c7 (patch) | |
tree | 4ee501ed4ee053e1c29de6cd4655507d1d53d0a1 /fs | |
parent | b6cfbecafbd2ee9407844122c928ff5147747a86 (diff) | |
download | lwn-0aac4bce4b49e58c43181d293da491cd2bdba6c7.tar.gz lwn-0aac4bce4b49e58c43181d293da491cd2bdba6c7.zip |
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: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/proc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 3512b9b66caf..0c3285c8db95 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -326,6 +326,7 @@ static int afs_proc_servers_show(struct seq_file *m, void *v) { struct afs_server *server; struct afs_addr_list *alist; + int i; if (v == SEQ_START_TOKEN) { seq_puts(m, "UUID USE ADDR\n"); @@ -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); alist = rcu_dereference(server->addresses); - seq_printf(m, "%pU %3d %pISp\n", + seq_printf(m, "%pU %3d %pISpc%s\n", &server->uuid, 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; } |