summaryrefslogtreecommitdiff
path: root/fs/afs/addr_list.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-25 17:53:33 +0100
committerDavid Howells <dhowells@redhat.com>2023-12-24 15:22:53 +0000
commitaa453becce5d1ae1b94b7fc22f47d7b05d22b14e (patch)
tree933b826c996b2688608d7108d04ff03d390b9585 /fs/afs/addr_list.c
parent6f2ff7e89bd05677f4c08fccafcf625ca3e09c1c (diff)
afs: Simplify error handling
Simplify error handling a bit by moving it from the afs_addr_cursor struct to the afs_operation and afs_vl_cursor structs and using the error prioritisation function for accumulating errors from multiple sources (AFS tries to rotate between multiple fileservers, some of which may be inaccessible or in some state of offlinedness). 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/addr_list.c')
-rw-r--r--fs/afs/addr_list.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/afs/addr_list.c b/fs/afs/addr_list.c
index b76abf500713..a1f3c995e328 100644
--- a/fs/afs/addr_list.c
+++ b/fs/afs/addr_list.c
@@ -386,26 +386,24 @@ bool afs_iterate_addresses(struct afs_addr_cursor *ac)
selected:
ac->index = index;
set_bit(index, &ac->tried);
- ac->responded = false;
+ ac->call_responded = false;
return true;
}
/*
* Release an address list cursor.
*/
-int afs_end_cursor(struct afs_addr_cursor *ac)
+void afs_end_cursor(struct afs_addr_cursor *ac)
{
struct afs_addr_list *alist;
alist = ac->alist;
if (alist) {
- if (ac->responded &&
+ if (ac->call_responded &&
ac->index != alist->preferred &&
test_bit(ac->alist->preferred, &ac->tried))
WRITE_ONCE(alist->preferred, ac->index);
afs_put_addrlist(alist);
ac->alist = NULL;
}
-
- return ac->error;
}