summaryrefslogtreecommitdiffstats
path: root/fs/afs/proc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-04-17 17:31:26 +0100
committerDavid Howells <dhowells@redhat.com>2020-05-31 15:19:51 +0100
commit977e5f8ed0ab2786755f8d2a96b78a3c7320f7c4 (patch)
tree770d0ffe055cd48fec774f9a671ee5c8353391a7 /fs/afs/proc.c
parent810068059234551b6973b46ca572e654f0c5e665 (diff)
downloadlinux-977e5f8ed0ab2786755f8d2a96b78a3c7320f7c4.tar.bz2
afs: Split the usage count on struct afs_server
Split the usage count on the afs_server struct to have an active count that registers who's actually using it separately from the reference count on the object. This allows a future patch to dispatch polling probes without advancing the "unuse" time into the future each time we emit a probe, which would otherwise prevent unused server records from expiring. Included in this: (1) The latter part of afs_destroy_server() in which the RCU destruction of afs_server objects is invoked and the outstanding server count is decremented is split out into __afs_put_server(). (2) afs_put_server() now calls __afs_put_server() rather then setting the management timer. (3) The calls begun by afs_fs_give_up_all_callbacks() and afs_fs_get_capabilities() can now take a ref on the server record, so afs_destroy_server() can just drop its ref and needn't wait for the completion of these calls. They'll put the ref when they're done. (4) Because of (3), afs_fs_probe_done() no longer needs to wake up afs_destroy_server() with server->probe_outstanding. (5) afs_gc_servers can be simplified. It only needs to check if server->active is 0 rather than playing games with the refcount. (6) afs_manage_servers() can propose a server for gc if usage == 0 rather than if ref == 1. The gc is effected by (5). Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/proc.c')
-rw-r--r--fs/afs/proc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 468e1713bce1..9bce7898cd7d 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -378,19 +378,20 @@ static int afs_proc_servers_show(struct seq_file *m, void *v)
int i;
if (v == SEQ_START_TOKEN) {
- seq_puts(m, "UUID USE ADDR\n");
+ seq_puts(m, "UUID REF ACT ADDR\n");
return 0;
}
server = list_entry(v, struct afs_server, proc_link);
alist = rcu_dereference(server->addresses);
- seq_printf(m, "%pU %3d %pISpc%s\n",
+ seq_printf(m, "%pU %3d %3d %pISpc%s\n",
&server->uuid,
- atomic_read(&server->usage),
+ atomic_read(&server->ref),
+ atomic_read(&server->active),
&alist->addrs[0].transport,
alist->preferred == 0 ? "*" : "");
for (i = 1; i < alist->nr_addrs; i++)
- seq_printf(m, " %pISpc%s\n",
+ seq_printf(m, " %pISpc%s\n",
&alist->addrs[i].transport,
alist->preferred == i ? "*" : "");
return 0;