1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

misc: disambiguate 'update_pool_params'

s/update_pool_params/update_thin_pool_params/ to disambiguate it from
a future 'update_cache_pool_params'.
This commit is contained in:
Jonathan Brassow 2014-02-04 09:58:35 -06:00
parent afe2ba657b
commit 8ddc7f641c
4 changed files with 41 additions and 23 deletions

View File

@ -700,7 +700,8 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
int passed_args, int *chunk_size_calc_method, int passed_args, int *chunk_size_calc_method,
uint32_t *chunk_size, thin_discards_t *discards, uint32_t *chunk_size, thin_discards_t *discards,
int *zero); int *zero);
int update_pool_params(struct volume_group *vg, unsigned attr, int passed_args, int update_thin_pool_params(struct volume_group *vg, unsigned attr,
int passed_args,
uint32_t data_extents, uint32_t extent_size, uint32_t data_extents, uint32_t extent_size,
int *chunk_size_calc_method, uint32_t *chunk_size, int *chunk_size_calc_method, uint32_t *chunk_size,
thin_discards_t *discards, thin_discards_t *discards,

View File

@ -420,11 +420,12 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
return 1; return 1;
} }
int update_pool_params(struct volume_group *vg, unsigned attr, int passed_args, int update_thin_pool_params(struct volume_group *vg, unsigned attr,
int passed_args,
uint32_t data_extents, uint32_t extent_size, uint32_t data_extents, uint32_t extent_size,
int *chunk_size_calc_method, uint32_t *chunk_size, int *chunk_size_calc_method, uint32_t *chunk_size,
thin_discards_t *discards, uint64_t *pool_metadata_size, thin_discards_t *discards,
int *zero) uint64_t *pool_metadata_size, int *zero)
{ {
size_t estimate_chunk_size; size_t estimate_chunk_size;
struct cmd_context *cmd = vg->cmd; struct cmd_context *cmd = vg->cmd;

View File

@ -2645,10 +2645,15 @@ static int _lvconvert_thinpool(struct cmd_context *cmd,
} }
if (!lp->pool_metadata_lv_name) { if (!lp->pool_metadata_lv_name) {
if (!update_pool_params(pool_lv->vg, lp->target_attr, lp->passed_args, if (!update_thin_pool_params(pool_lv->vg, lp->target_attr,
pool_lv->le_count, pool_lv->vg->extent_size, lp->passed_args,
&lp->thin_chunk_size_calc_policy, &lp->chunk_size, pool_lv->le_count,
&lp->discards, &lp->poolmetadata_size, &lp->zero)) pool_lv->vg->extent_size,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size,
&lp->discards,
&lp->poolmetadata_size,
&lp->zero))
return_0; return_0;
if (!get_stripe_params(cmd, &lp->stripes, &lp->stripe_size)) if (!get_stripe_params(cmd, &lp->stripes, &lp->stripe_size))
@ -2752,10 +2757,15 @@ static int _lvconvert_thinpool(struct cmd_context *cmd,
display_size(cmd, 2 * DEFAULT_THIN_POOL_MIN_METADATA_SIZE)); display_size(cmd, 2 * DEFAULT_THIN_POOL_MIN_METADATA_SIZE));
return 0; return 0;
} }
if (!update_pool_params(pool_lv->vg, lp->target_attr, lp->passed_args, if (!update_thin_pool_params(pool_lv->vg, lp->target_attr,
pool_lv->le_count, pool_lv->vg->extent_size, lp->passed_args,
&lp->thin_chunk_size_calc_policy, &lp->chunk_size, pool_lv->le_count,
&lp->discards, &lp->poolmetadata_size, &lp->zero)) pool_lv->vg->extent_size,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size,
&lp->discards,
&lp->poolmetadata_size,
&lp->zero))
return_0; return_0;
metadata_lv->status |= LV_TEMPORARY; metadata_lv->status |= LV_TEMPORARY;

View File

@ -227,6 +227,16 @@ static int _determine_snapshot_type(struct volume_group *vg,
return 1; return 1;
} }
static int _lvcreate_update_pool_params(struct volume_group *vg,
struct lvcreate_params *lp)
{
return update_thin_pool_params(vg, lp->target_attr, lp->passed_args,
lp->extents, vg->extent_size,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size, &lp->discards,
&lp->poolmetadatasize, &lp->zero);
}
/* /*
* Update extents parameters based on other parameters which affect the size * Update extents parameters based on other parameters which affect the size
* calculation. * calculation.
@ -334,11 +344,7 @@ static int _update_extents_params(struct volume_group *vg,
} }
if (lp->create_pool) { if (lp->create_pool) {
if (!update_pool_params(vg, lp->target_attr, lp->passed_args, if (!_lvcreate_update_pool_params(vg, lp))
lp->extents, vg->extent_size,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size, &lp->discards,
&lp->poolmetadatasize, &lp->zero))
return_0; return_0;
if (!(lp->poolmetadataextents = if (!(lp->poolmetadataextents =