summaryrefslogtreecommitdiff
path: root/drivers/md/dm-io.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2023-01-30 22:13:54 +0100
committerMike Snitzer <snitzer@kernel.org>2023-02-14 14:23:06 -0500
commit03b18887703c5fa342896e52e873812ea33d964b (patch)
treef4018443dba31b2c4bfd2efb7c376ff00c8c7e66 /drivers/md/dm-io.c
parent43be9c743c2553519c2093d1798b542f28095a51 (diff)
dm: fix trailing statements
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-io.c')
-rw-r--r--drivers/md/dm-io.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index 628c5a13d010..c7abcc2deca3 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -359,18 +359,20 @@ static void do_region(const blk_opf_t opf, unsigned int region,
num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining);
bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
remaining -= num_sectors;
- } else while (remaining) {
- /*
- * Try and add as many pages as possible.
- */
- dp->get_page(dp, &page, &len, &offset);
- len = min(len, to_bytes(remaining));
- if (!bio_add_page(bio, page, len, offset))
- break;
-
- offset = 0;
- remaining -= to_sector(len);
- dp->next_page(dp);
+ } else {
+ while (remaining) {
+ /*
+ * Try and add as many pages as possible.
+ */
+ dp->get_page(dp, &page, &len, &offset);
+ len = min(len, to_bytes(remaining));
+ if (!bio_add_page(bio, page, len, offset))
+ break;
+
+ offset = 0;
+ remaining -= to_sector(len);
+ dp->next_page(dp);
+ }
}
atomic_inc(&io->count);