summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2022-06-16 22:19:39 +0300
committerJens Axboe <axboe@kernel.dk>2022-08-03 02:14:42 +0300
commit0a2d1694de6095dadbc99a6eb803ebab381de09e (patch)
tree9e5fbb04ebf663a8fad3fed314efdcd9ae400bc7 /drivers/md
parent4f35456076e1b63630f38879efb7db623906e1e8 (diff)
downloadlinux-0a2d1694de6095dadbc99a6eb803ebab381de09e.tar.xz
md/raid5: Refactor for loop in raid5_make_request() into while loop
The for loop with retry label can be more cleanly expressed as a while loop by moving the logical_sector increment into the success path. No functional changes intended. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Song Liu <song@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 57a5a03c37f6..025228a22522 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5975,22 +5975,23 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
}
md_account_bio(mddev, &bi);
prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
- for (; logical_sector < last_sector; logical_sector += RAID5_STRIPE_SECTORS(conf)) {
- retry:
+ while (logical_sector < last_sector) {
res = make_stripe_request(mddev, conf, &ctx, logical_sector,
bi);
if (res == STRIPE_FAIL)
break;
if (res == STRIPE_RETRY)
- goto retry;
+ continue;
if (res == STRIPE_SCHEDULE_AND_RETRY) {
schedule();
prepare_to_wait(&conf->wait_for_overlap, &w,
TASK_UNINTERRUPTIBLE);
- goto retry;
+ continue;
}
+
+ logical_sector += RAID5_STRIPE_SECTORS(conf);
}
finish_wait(&conf->wait_for_overlap, &w);