Skip to content

Commit 0a2d169

Browse files
lsgunthaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Song Liu <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 4f35456 commit 0a2d169

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/md/raid5.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5975,22 +5975,23 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)
59755975
}
59765976
md_account_bio(mddev, &bi);
59775977
prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
5978-
for (; logical_sector < last_sector; logical_sector += RAID5_STRIPE_SECTORS(conf)) {
5979-
retry:
5978+
while (logical_sector < last_sector) {
59805979
res = make_stripe_request(mddev, conf, &ctx, logical_sector,
59815980
bi);
59825981
if (res == STRIPE_FAIL)
59835982
break;
59845983

59855984
if (res == STRIPE_RETRY)
5986-
goto retry;
5985+
continue;
59875986

59885987
if (res == STRIPE_SCHEDULE_AND_RETRY) {
59895988
schedule();
59905989
prepare_to_wait(&conf->wait_for_overlap, &w,
59915990
TASK_UNINTERRUPTIBLE);
5992-
goto retry;
5991+
continue;
59935992
}
5993+
5994+
logical_sector += RAID5_STRIPE_SECTORS(conf);
59945995
}
59955996

59965997
finish_wait(&conf->wait_for_overlap, &w);

0 commit comments

Comments
 (0)