1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

dm: remove useless loop in __split_and_process_bio

Remove useless "while" loop. If the condition ci.sector_count && !error is
true, we go to a branch that ends with "break". If this condition is
false, the "while" loop will not be executed again. So, the loop can't be
executed more than once.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
Mikulas Patocka 2021-03-01 04:58:43 -05:00 committed by Mike Snitzer
parent c40819f267
commit 8615cb65bd

View file

@ -1641,7 +1641,6 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md,
} else { } else {
ci.bio = bio; ci.bio = bio;
ci.sector_count = bio_sectors(bio); ci.sector_count = bio_sectors(bio);
while (ci.sector_count && !error) {
error = __split_and_process_non_flush(&ci); error = __split_and_process_non_flush(&ci);
if (ci.sector_count && !error) { if (ci.sector_count && !error) {
/* /*
@ -1671,8 +1670,6 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md,
bio_chain(b, bio); bio_chain(b, bio);
trace_block_split(b, bio->bi_iter.bi_sector); trace_block_split(b, bio->bi_iter.bi_sector);
ret = submit_bio_noacct(bio); ret = submit_bio_noacct(bio);
break;
}
} }
} }