1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

vdo: keep minimum_io_size in sectors

This commit is contained in:
Zdenek Kabelac 2019-10-04 14:58:18 +02:00
parent aad91330fe
commit 9d8a028e8c
5 changed files with 8 additions and 6 deletions

View File

@ -2755,7 +2755,7 @@ static int _vdo_emit_segment_line(struct dm_task *dmt,
"maxDiscard %u ack %u bio %u bioRotationInterval %u cpu %u hash %u logical %u physical %u",
data_dev,
seg->vdo_data_size / 8, // this parameter is in 4K units
seg->vdo_params.minimum_io_size,
seg->vdo_params.minimum_io_size * UINT32_C(512), // sector to byte units
seg->vdo_params.block_map_cache_size_mb * UINT64_C(256), // 1MiB -> 4KiB units
seg->vdo_params.block_map_era_length,
seg->vdo_params.use_metadata_hints ? "on" : "off" ,

View File

@ -74,7 +74,7 @@ enum dm_vdo_write_policy {
// FIXME: review whether we should use the createParams from the userlib
struct dm_vdo_target_params {
uint32_t minimum_io_size;
uint32_t minimum_io_size; // in sectors
uint32_t block_map_cache_size_mb;
uint32_t block_map_era_length; // format period

View File

@ -23,8 +23,9 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
{
bool valid = true;
if ((vtp->minimum_io_size != 512) &&
(vtp->minimum_io_size != 4096)) {
/* 512 or 4096 bytes only ATM */
if ((vtp->minimum_io_size != 1) &&
(vtp->minimum_io_size != 8)) {
log_error("VDO minimum io size %u is unsupported.",
vtp->minimum_io_size);
valid = false;

View File

@ -436,7 +436,7 @@ int fill_vdo_target_params(struct cmd_context *cmd,
vtp->use_metadata_hints =
find_config_tree_int(cmd, allocation_vdo_use_metadata_hints_CFG, profile);
vtp->minimum_io_size =
find_config_tree_int(cmd, allocation_vdo_minimum_io_size_CFG, profile);
find_config_tree_int(cmd, allocation_vdo_minimum_io_size_CFG, profile) >> SECTOR_SHIFT;
vtp->block_map_cache_size_mb =
find_config_tree_int64(cmd, allocation_vdo_block_map_cache_size_mb_CFG, profile);
vtp->block_map_era_length =

View File

@ -239,6 +239,7 @@ static int _vdo_pool_text_import(struct lv_segment *seg,
if (!dm_config_get_uint32(n, "minimum_io_size", &vtp->minimum_io_size))
return _bad_field("minimum_io_size");
vtp->minimum_io_size >>= SECTOR_SHIFT; // keep in sectors, while metadata uses bytes
if (!dm_config_get_uint32(n, "block_map_cache_size_mb", &vtp->block_map_cache_size_mb))
return _bad_field("block_map_cache_size_mb");
@ -308,7 +309,7 @@ static int _vdo_pool_text_export(const struct lv_segment *seg, struct formatter
if (vtp->use_metadata_hints)
outf(f, "use_metadata_hints = 1");
outf(f, "minimum_io_size = %u", vtp->minimum_io_size);
outf(f, "minimum_io_size = %u", (vtp->minimum_io_size << SECTOR_SHIFT));
outsize(f, vtp->block_map_cache_size_mb * UINT64_C(2 * 1024),
"block_map_cache_size_mb = %u", vtp->block_map_cache_size_mb);