summaryrefslogtreecommitdiff
path: root/fs/afs/server_list.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-11-07 20:59:33 +0300
committerDavid Howells <dhowells@redhat.com>2024-01-01 19:37:27 +0300
commit32222f09782f1894fcfc37f6505ca676a6f4d1d6 (patch)
tree1248a3f6afb42e60625076444eac20e6eb9d1aeb /fs/afs/server_list.c
parentdfa0a44946e29bd38c054df04ca7a3f8143dafe7 (diff)
downloadlinux-32222f09782f1894fcfc37f6505ca676a6f4d1d6.tar.xz
afs: Apply server breaks to mmap'd files in the call processor
Apply server breaks to mmap'd files that are being used from that server from the call processor work function rather than punting it off to a workqueue. The work item, afs_server_init_callback(), then bumps each individual inode off to its own work item introducing a potentially lengthy delay. This reduces that delay at the cost of extending the amount of time we delay replying to the CB.InitCallBack3 notification RPC from the server. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org
Diffstat (limited to 'fs/afs/server_list.c')
-rw-r--r--fs/afs/server_list.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/afs/server_list.c b/fs/afs/server_list.c
index 4d6369477f54..cfd900eb09ed 100644
--- a/fs/afs/server_list.c
+++ b/fs/afs/server_list.c
@@ -136,7 +136,7 @@ void afs_attach_volume_to_servers(struct afs_volume *volume, struct afs_server_l
struct list_head *p;
unsigned int i;
- spin_lock(&volume->cell->vs_lock);
+ down_write(&volume->cell->vs_lock);
for (i = 0; i < slist->nr_servers; i++) {
se = &slist->servers[i];
@@ -147,11 +147,11 @@ void afs_attach_volume_to_servers(struct afs_volume *volume, struct afs_server_l
if (volume->vid <= pe->volume->vid)
break;
}
- list_add_tail_rcu(&se->slink, p);
+ list_add_tail(&se->slink, p);
}
slist->attached = true;
- spin_unlock(&volume->cell->vs_lock);
+ up_write(&volume->cell->vs_lock);
}
/*
@@ -164,7 +164,7 @@ void afs_reattach_volume_to_servers(struct afs_volume *volume, struct afs_server
{
unsigned int n = 0, o = 0;
- spin_lock(&volume->cell->vs_lock);
+ down_write(&volume->cell->vs_lock);
while (n < new->nr_servers || o < old->nr_servers) {
struct afs_server_entry *pn = n < new->nr_servers ? &new->servers[n] : NULL;
@@ -174,7 +174,7 @@ void afs_reattach_volume_to_servers(struct afs_volume *volume, struct afs_server
int diff;
if (pn && po && pn->server == po->server) {
- list_replace_rcu(&po->slink, &pn->slink);
+ list_replace(&po->slink, &pn->slink);
n++;
o++;
continue;
@@ -192,15 +192,15 @@ void afs_reattach_volume_to_servers(struct afs_volume *volume, struct afs_server
if (volume->vid <= s->volume->vid)
break;
}
- list_add_tail_rcu(&pn->slink, p);
+ list_add_tail(&pn->slink, p);
n++;
} else {
- list_del_rcu(&po->slink);
+ list_del(&po->slink);
o++;
}
}
- spin_unlock(&volume->cell->vs_lock);
+ up_write(&volume->cell->vs_lock);
}
/*
@@ -213,11 +213,11 @@ void afs_detach_volume_from_servers(struct afs_volume *volume, struct afs_server
if (!slist->attached)
return;
- spin_lock(&volume->cell->vs_lock);
+ down_write(&volume->cell->vs_lock);
for (i = 0; i < slist->nr_servers; i++)
- list_del_rcu(&slist->servers[i].slink);
+ list_del(&slist->servers[i].slink);
slist->attached = false;
- spin_unlock(&volume->cell->vs_lock);
+ up_write(&volume->cell->vs_lock);
}