summaryrefslogtreecommitdiff
path: root/fs/afs/rotate.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-20 16:04:52 +0100
committerDavid Howells <dhowells@redhat.com>2023-12-24 15:22:52 +0000
commit075171fd22be33acf4ab354814bfa6de1c3412ce (patch)
tree25208765995db93041ee54e2051d5950f884729e /fs/afs/rotate.c
parenteb8eae65f0c713bcef84b082aa919f72c3d83268 (diff)
afs: Use op->nr_iterations=-1 to indicate to begin fileserver iteration
Set op->nr_iterations to -1 to indicate that we need to begin fileserver iteration rather than setting error to SHRT_MAX. This makes it easier to eliminate the address cursor. 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/rotate.c')
-rw-r--r--fs/afs/rotate.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c
index 0829933f4d9a..4d2317a66385 100644
--- a/fs/afs/rotate.c
+++ b/fs/afs/rotate.c
@@ -116,7 +116,10 @@ bool afs_select_fileserver(struct afs_operation *op)
unsigned int rtt;
int error = op->ac.error, i;
- _enter("%lx[%d],%lx[%d],%d,%d",
+ op->nr_iterations++;
+
+ _enter("OP=%x+%x,%llx,%lx[%d],%lx[%d],%d,%d",
+ op->debug_id, op->nr_iterations, op->volume->vid,
op->untried, op->index,
op->ac.tried, op->ac.index,
error, op->ac.abort_code);
@@ -126,13 +129,11 @@ bool afs_select_fileserver(struct afs_operation *op)
return false;
}
- op->nr_iterations++;
+ if (op->nr_iterations == 0)
+ goto start;
/* Evaluate the result of the previous operation, if there was one. */
switch (error) {
- case SHRT_MAX:
- goto start;
-
case 0:
default:
/* Success or local failure. Stop. */