1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

cleanup: move code

This commit is contained in:
Zdenek Kabelac 2014-10-18 11:01:34 +02:00
parent 4f8ed25a99
commit cf674142a2
2 changed files with 6 additions and 9 deletions

View File

@ -6573,7 +6573,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
{
struct cmd_context *cmd = vg->cmd;
uint32_t size_rest;
uint64_t status = UINT64_C(0);
uint64_t status = lp->permission | VISIBLE_LV;
struct logical_volume *lv, *origin_lv = NULL;
struct logical_volume *pool_lv;
struct logical_volume *tmp_lv;
@ -6672,8 +6672,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
lp->extents = lp->extents - size_rest + lp->stripes;
}
status |= lp->permission | VISIBLE_LV;
if (seg_is_cache(lp)) {
if (!lp->pool_name) {
log_error(INTERNAL_ERROR "Cannot create thin volume without thin pool.");
@ -6900,6 +6898,9 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
if (!recalculate_pool_chunk_size_with_dev_hints(lv, lp->passed_args,
THIN_CHUNK_SIZE_CALC_METHOD_GENERIC))
return_NULL;
} else if (seg_is_raid(lp)) {
first_seg(lv)->min_recovery_rate = lp->min_recovery_rate;
first_seg(lv)->max_recovery_rate = lp->max_recovery_rate;
} else if (seg_is_thin_pool(lp)) {
first_seg(lv)->chunk_size = lp->chunk_size;
first_seg(lv)->zero_new_blocks = lp->zero ? 1 : 0;
@ -6936,9 +6937,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
if (!attach_pool_message(first_seg(pool_lv),
DM_THIN_MESSAGE_CREATE_THIN, lv, 0, 0))
return_NULL;
} else if (seg_is_raid(lp)) {
first_seg(lv)->min_recovery_rate = lp->min_recovery_rate;
first_seg(lv)->max_recovery_rate = lp->max_recovery_rate;
}
/* FIXME Log allocation and attachment should have happened inside lv_extend. */

View File

@ -806,9 +806,6 @@ static int _read_activation_params(struct lvcreate_params *lp,
return 0;
}
lp->yes = arg_count(cmd, yes_ARG);
lp->force = (force_t) arg_count(cmd, force_ARG);
return 1;
}
@ -825,6 +822,8 @@ static int _lvcreate_params(struct lvcreate_params *lp,
memset(lcp, 0, sizeof(*lcp));
dm_list_init(&lp->tags);
lp->target_attr = ~0;
lp->yes = arg_count(cmd, yes_ARG);
lp->force = (force_t) arg_count(cmd, force_ARG);
/* Set default segtype - remember, '-m 0' implies stripe. */
if (arg_count(cmd, mirrors_ARG) &&