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>
This commit is contained in:
parent
4f35456076
commit
0a2d1694de
@ -5975,22 +5975,23 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
|
|||||||
}
|
}
|
||||||
md_account_bio(mddev, &bi);
|
md_account_bio(mddev, &bi);
|
||||||
prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
|
prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
|
||||||
for (; logical_sector < last_sector; logical_sector += RAID5_STRIPE_SECTORS(conf)) {
|
while (logical_sector < last_sector) {
|
||||||
retry:
|
|
||||||
res = make_stripe_request(mddev, conf, &ctx, logical_sector,
|
res = make_stripe_request(mddev, conf, &ctx, logical_sector,
|
||||||
bi);
|
bi);
|
||||||
if (res == STRIPE_FAIL)
|
if (res == STRIPE_FAIL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (res == STRIPE_RETRY)
|
if (res == STRIPE_RETRY)
|
||||||
goto retry;
|
continue;
|
||||||
|
|
||||||
if (res == STRIPE_SCHEDULE_AND_RETRY) {
|
if (res == STRIPE_SCHEDULE_AND_RETRY) {
|
||||||
schedule();
|
schedule();
|
||||||
prepare_to_wait(&conf->wait_for_overlap, &w,
|
prepare_to_wait(&conf->wait_for_overlap, &w,
|
||||||
TASK_UNINTERRUPTIBLE);
|
TASK_UNINTERRUPTIBLE);
|
||||||
goto retry;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logical_sector += RAID5_STRIPE_SECTORS(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_wait(&conf->wait_for_overlap, &w);
|
finish_wait(&conf->wait_for_overlap, &w);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user