Commit f8ae7525 authored by Mike Snitzer's avatar Mike Snitzer

dm thin: cleanup schedule_zero() to read more logically

The overwrite has only ever about optimizing away the need to zero a
block if the entire block was being overwritten.  As such it is only
relevant when zeroing is enabled.
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
parent 8b908f8e
...@@ -1086,16 +1086,14 @@ static void schedule_zero(struct thin_c *tc, dm_block_t virt_block, ...@@ -1086,16 +1086,14 @@ static void schedule_zero(struct thin_c *tc, dm_block_t virt_block,
* zeroing pre-existing data, we can issue the bio immediately. * zeroing pre-existing data, we can issue the bio immediately.
* Otherwise we use kcopyd to zero the data first. * Otherwise we use kcopyd to zero the data first.
*/ */
if (!pool->pf.zero_new_blocks) if (pool->pf.zero_new_blocks) {
process_prepared_mapping(m); if (io_overwrites_block(pool, bio))
else if (io_overwrites_block(pool, bio))
remap_and_issue_overwrite(tc, bio, data_block, m); remap_and_issue_overwrite(tc, bio, data_block, m);
else else
ll_zero(tc, m, ll_zero(tc, m, data_block * pool->sectors_per_block,
data_block * pool->sectors_per_block,
(data_block + 1) * pool->sectors_per_block); (data_block + 1) * pool->sectors_per_block);
} else
process_prepared_mapping(m);
} }
static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment