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

add lvid to lv_create_empty

This commit is contained in:
Alasdair Kergon 2005-04-07 12:29:46 +00:00
parent 69b2cc0ee0
commit 3a6edbed16
5 changed files with 12 additions and 2 deletions

View File

@ -543,6 +543,7 @@ static char *_generate_lv_name(struct volume_group *vg, const char *format,
struct logical_volume *lv_create_empty(struct format_instance *fi,
const char *name,
const char *name_format,
union lvid *lvid,
uint32_t status,
alloc_policy_t alloc,
struct volume_group *vg)
@ -595,6 +596,9 @@ struct logical_volume *lv_create_empty(struct format_instance *fi,
list_init(&lv->segments);
list_init(&lv->tags);
if (lvid)
lv->lvid = *lvid;
if (fi->fmt->ops->lv_setup && !fi->fmt->ops->lv_setup(fi, lv)) {
stack;
if (ll)

View File

@ -421,6 +421,7 @@ int vg_extend(struct format_instance *fi, struct volume_group *vg,
struct logical_volume *lv_create_empty(struct format_instance *fi,
const char *name,
const char *name_format,
union lvid *lvid,
uint32_t status,
alloc_policy_t alloc,
struct volume_group *vg);

View File

@ -512,7 +512,7 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp)
return 0;
}
if (!(lv = lv_create_empty(vg->fid, lp->lv_name, "lvol%d",
if (!(lv = lv_create_empty(vg->fid, lp->lv_name, "lvol%d", NULL,
status, lp->alloc, vg))) {
stack;
return 0;

View File

@ -72,6 +72,8 @@ static int _check_mirror_status(struct cmd_context *cmd,
float segment_percent = 0.0, overall_percent = 0.0;
uint32_t event_nr = 0;
void *x;
/* By default, caller should not retry */
*finished = 1;
@ -97,6 +99,9 @@ static int _check_mirror_status(struct cmd_context *cmd,
else
log_verbose("%s: Moved: %.1f%%", name, overall_percent);
x = pool_alloc(cmd->mem, 1);
pool_free(cmd->mem, x);
if (segment_percent < 100.0) {
/* The only case the caller *should* try again later */
*finished = 0;

View File

@ -141,7 +141,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
/* FIXME Cope with non-contiguous => splitting existing segments */
/* FIXME Pass 'alloc' down to lv_extend */
if (!(lv_mirr = lv_create_empty(vg->fid, NULL, "pvmove%d",
if (!(lv_mirr = lv_create_empty(vg->fid, NULL, "pvmove%d", NULL,
LVM_READ | LVM_WRITE,
ALLOC_CONTIGUOUS, vg))) {
log_error("Creation of temporary pvmove LV failed");