1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +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,11 +700,12 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
int passed_args, int *chunk_size_calc_method,
uint32_t *chunk_size, thin_discards_t *discards,
int *zero);
int update_pool_params(struct volume_group *vg, unsigned attr, int passed_args,
uint32_t data_extents, uint32_t extent_size,
int *chunk_size_calc_method, uint32_t *chunk_size,
thin_discards_t *discards,
uint64_t *pool_metadata_size, int *zero);
int update_thin_pool_params(struct volume_group *vg, unsigned attr,
int passed_args,
uint32_t data_extents, uint32_t extent_size,
int *chunk_size_calc_method, uint32_t *chunk_size,
thin_discards_t *discards,
uint64_t *pool_metadata_size, int *zero);
int get_pool_discards(const char *str, thin_discards_t *discards);
const char *get_pool_discards_name(thin_discards_t discards);
struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,

View File

@ -420,11 +420,12 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi
return 1;
}
int update_pool_params(struct volume_group *vg, unsigned attr, int passed_args,
uint32_t data_extents, uint32_t extent_size,
int *chunk_size_calc_method, uint32_t *chunk_size,
thin_discards_t *discards, uint64_t *pool_metadata_size,
int *zero)
int update_thin_pool_params(struct volume_group *vg, unsigned attr,
int passed_args,
uint32_t data_extents, uint32_t extent_size,
int *chunk_size_calc_method, uint32_t *chunk_size,
thin_discards_t *discards,
uint64_t *pool_metadata_size, int *zero)
{
size_t estimate_chunk_size;
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 (!update_pool_params(pool_lv->vg, lp->target_attr, lp->passed_args,
pool_lv->le_count, pool_lv->vg->extent_size,
&lp->thin_chunk_size_calc_policy, &lp->chunk_size,
&lp->discards, &lp->poolmetadata_size, &lp->zero))
if (!update_thin_pool_params(pool_lv->vg, lp->target_attr,
lp->passed_args,
pool_lv->le_count,
pool_lv->vg->extent_size,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size,
&lp->discards,
&lp->poolmetadata_size,
&lp->zero))
return_0;
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));
return 0;
}
if (!update_pool_params(pool_lv->vg, lp->target_attr, lp->passed_args,
pool_lv->le_count, pool_lv->vg->extent_size,
&lp->thin_chunk_size_calc_policy, &lp->chunk_size,
&lp->discards, &lp->poolmetadata_size, &lp->zero))
if (!update_thin_pool_params(pool_lv->vg, lp->target_attr,
lp->passed_args,
pool_lv->le_count,
pool_lv->vg->extent_size,
&lp->thin_chunk_size_calc_policy,
&lp->chunk_size,
&lp->discards,
&lp->poolmetadata_size,
&lp->zero))
return_0;
metadata_lv->status |= LV_TEMPORARY;

View File

@ -227,6 +227,16 @@ static int _determine_snapshot_type(struct volume_group *vg,
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
* calculation.
@ -334,11 +344,7 @@ static int _update_extents_params(struct volume_group *vg,
}
if (lp->create_pool) {
if (!update_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))
if (!_lvcreate_update_pool_params(vg, lp))
return_0;
if (!(lp->poolmetadataextents =