master - misc: disambiguate 'update_pool_params'
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8ddc7f641ced0a32801d978cd4e8a70883c4897a Commit: 8ddc7f641ced0a32801d978cd4e8a70883c4897a Parent: afe2ba657bfa20fa755e71a039ee9cb9027adb1b Author: Jonathan Brassow <[email protected]> AuthorDate: Tue Feb 4 09:58:35 2014 -0600 Committer: Jonathan Brassow <[email protected]> CommitterDate: Tue Feb 4 09:58:35 2014 -0600
misc: disambiguate 'update_pool_params'
s/update_pool_params/update_thin_pool_params/ to disambiguate it from a future 'update_cache_pool_params'.
--- lib/metadata/metadata-exported.h | 11 ++++++----- lib/metadata/thin_manip.c | 11 ++++++----- tools/lvconvert.c | 26 ++++++++++++++++++-------- tools/lvcreate.c | 16 +++++++++++----- 4 files changed, 41 insertions(+), 23 deletions(-)
lib/metadata/metadata-exported.h +6 -5
@@ -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,
lib/metadata/thin_manip.c +6 -5
@@ -420,11 +420,12 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profireturn 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;
tools/lvconvert.c +18 -8
@@ -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 ;
tools/lvcreate.c +11 -5
@@ -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 =