From d14cf8edd30678b5d1e3671466d458bf72a53e86 Mon Sep 17 00:00:00 2001 From: David Howells Date: Mon, 30 Oct 2023 08:25:44 +0000 Subject: afs: Mark address lists with configured priorities Add a field to each address in an address list (afs_addr_list struct) that records the current priority for that address according to the address preference table. We don't want to do this every time we use an address list, so the version number of the address preference table is recorded in the address list too and we only re-mark the list when we see the version change. These numbers are then displayed through /proc/net/afs/servers. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/proc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'fs/afs/proc.c') diff --git a/fs/afs/proc.c b/fs/afs/proc.c index 2e63c99a4f1e..944eb51e75a1 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -447,17 +447,18 @@ static int afs_proc_servers_show(struct seq_file *m, void *v) (int)(jiffies - server->probed_at) / HZ, atomic_read(&server->probe_outstanding)); failed = alist->probe_failed; - seq_printf(m, " - ALIST v=%u rsp=%lx f=%lx\n", - alist->version, alist->responded, alist->probe_failed); + seq_printf(m, " - ALIST v=%u rsp=%lx f=%lx ap=%u\n", + alist->version, alist->responded, alist->probe_failed, + alist->addr_pref_version); for (i = 0; i < alist->nr_addrs; i++) { const struct afs_address *addr = &alist->addrs[i]; - seq_printf(m, " [%x] %pISpc%s rtt=%d err=%d\n", + seq_printf(m, " [%x] %pISpc%s rtt=%d err=%d p=%u\n", i, rxrpc_kernel_remote_addr(addr->peer), alist->preferred == i ? "*" : test_bit(i, &failed) ? "!" : "", rxrpc_kernel_get_srtt(addr->peer), - addr->last_error); + addr->last_error, addr->prio); } return 0; } -- cgit v1.2.3