aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/afs/fs_operation.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-20 16:13:03 +0100
committerDavid Howells <dhowells@redhat.com>2023-12-24 15:22:55 +0000
commit98f9fda2057ba34b720c4d353351024d6dcee90f (patch)
treeeae0890da4e6ca72e598247c3f2f248d37013929 /fs/afs/fs_operation.c
parentafs: Use peer + service_id as call address (diff)
downloadwireguard-linux-98f9fda2057ba34b720c4d353351024d6dcee90f.tar.xz
wireguard-linux-98f9fda2057ba34b720c4d353351024d6dcee90f.zip
afs: Fold the afs_addr_cursor struct in
Fold the afs_addr_cursor struct into the afs_operation struct and the afs_vl_cursor struct and fold its operations into their callers also. 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/fs_operation.c')
-rw-r--r--fs/afs/fs_operation.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/afs/fs_operation.c b/fs/afs/fs_operation.c
index cebe4fad8192..00e22259be36 100644
--- a/fs/afs/fs_operation.c
+++ b/fs/afs/fs_operation.c
@@ -179,6 +179,7 @@ void afs_wait_for_operation(struct afs_operation *op)
_enter("");
while (afs_select_fileserver(op)) {
+ op->call_responded = false;
op->call_error = 0;
op->call_abort_code = 0;
op->cb_s_break = op->server->cb_s_break;
@@ -191,17 +192,19 @@ void afs_wait_for_operation(struct afs_operation *op)
op->call_error = -ENOTSUPP;
if (op->call) {
- afs_wait_for_call_to_complete(op->call, &op->ac);
+ afs_wait_for_call_to_complete(op->call);
op->call_abort_code = op->call->abort_code;
op->call_error = op->call->error;
op->call_responded = op->call->responded;
- op->ac.call_responded = true;
- WRITE_ONCE(op->ac.alist->addrs[op->ac.index].last_error,
+ WRITE_ONCE(op->alist->addrs[op->addr_index].last_error,
op->call_error);
afs_put_call(op->call);
}
}
+ if (op->call_responded)
+ set_bit(AFS_SERVER_FL_RESPONDING, &op->server->flags);
+
if (!afs_op_error(op)) {
_debug("success");
op->ops->success(op);
@@ -227,6 +230,7 @@ void afs_wait_for_operation(struct afs_operation *op)
*/
int afs_put_operation(struct afs_operation *op)
{
+ struct afs_addr_list *alist;
int i, ret = afs_op_error(op);
_enter("op=%08x,%d", op->debug_id, ret);
@@ -249,7 +253,16 @@ int afs_put_operation(struct afs_operation *op)
kfree(op->more_files);
}
- afs_end_cursor(&op->ac);
+ alist = op->alist;
+ if (alist) {
+ if (op->call_responded &&
+ op->addr_index != alist->preferred &&
+ test_bit(alist->preferred, &op->addr_tried))
+ WRITE_ONCE(alist->preferred, op->addr_index);
+ afs_put_addrlist(alist, afs_alist_trace_put_operation);
+ op->alist = NULL;
+ }
+
afs_put_serverlist(op->net, op->server_list);
afs_put_volume(op->net, op->volume, afs_volume_trace_put_put_op);
key_put(op->key);