Skip to content

Commit 0aac4bc

Browse files
dhowellsAl Viro
authored andcommitted
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 <[email protected]>
1 parent b6cfbec commit 0aac4bc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

fs/afs/proc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ static int afs_proc_servers_show(struct seq_file *m, void *v)
326326
{
327327
struct afs_server *server;
328328
struct afs_addr_list *alist;
329+
int i;
329330

330331
if (v == SEQ_START_TOKEN) {
331332
seq_puts(m, "UUID USE ADDR\n");
@@ -334,10 +335,15 @@ static int afs_proc_servers_show(struct seq_file *m, void *v)
334335

335336
server = list_entry(v, struct afs_server, proc_link);
336337
alist = rcu_dereference(server->addresses);
337-
seq_printf(m, "%pU %3d %pISp\n",
338+
seq_printf(m, "%pU %3d %pISpc%s\n",
338339
&server->uuid,
339340
atomic_read(&server->usage),
340-
&alist->addrs[alist->index].transport);
341+
&alist->addrs[0].transport,
342+
alist->index == 0 ? "*" : "");
343+
for (i = 1; i < alist->nr_addrs; i++)
344+
seq_printf(m, " %pISpc%s\n",
345+
&alist->addrs[i].transport,
346+
alist->index == i ? "*" : "");
341347
return 0;
342348
}
343349

0 commit comments

Comments
 (0)