diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 250400efa..59fe2a2eb 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -1656,14 +1656,14 @@ char *generate_lv_name(struct volume_group *vg, const char *format, /* * Create a new empty LV. */ -struct logical_volume *lv_create_empty(struct format_instance *fi, - const char *name, +struct logical_volume *lv_create_empty(const char *name, union lvid *lvid, uint32_t status, alloc_policy_t alloc, int import, struct volume_group *vg) { + struct format_instance *fi = vg->fid; struct cmd_context *cmd = vg->cmd; struct lv_list *ll = NULL; struct logical_volume *lv; diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 70d42ee6a..9e5ac11d8 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -349,8 +349,7 @@ int vg_split_mdas(struct cmd_context *cmd, struct volume_group *vg_from, struct volume_group *vg_to); /* Manipulate LVs */ -struct logical_volume *lv_create_empty(struct format_instance *fi, - const char *name, +struct logical_volume *lv_create_empty(const char *name, union lvid *lvid, uint32_t status, alloc_policy_t alloc, diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 5e3c25948..014eae104 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -439,7 +439,7 @@ static int _create_layers_for_mirror(struct alloc_handle *ah, } for (m = 0; m < num_mirrors; m++) { - if (!(img_lvs[m] = lv_create_empty(lv->vg->fid, img_name, + if (!(img_lvs[m] = lv_create_empty(img_name, NULL, LVM_READ | LVM_WRITE, ALLOC_INHERIT, 0, lv->vg))) { log_error("Aborting. Failed to create mirror image LV. " diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index 4892334b7..d0a443ef8 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -53,7 +53,6 @@ int vg_add_snapshot(struct volume_group *vg, const char *name, struct logical_volume *cow, union lvid *lvid, uint32_t extent_count, uint32_t chunk_size) { - struct format_instance *fid = vg->fid; struct logical_volume *snap; struct lv_segment *seg; @@ -65,7 +64,7 @@ int vg_add_snapshot(struct volume_group *vg, const char *name, return 0; } - if (!(snap = lv_create_empty(fid, name ? name : "snapshot%d", + if (!(snap = lv_create_empty(name ? name : "snapshot%d", lvid, LVM_READ | LVM_WRITE | VISIBLE_LV, ALLOC_INHERIT, 1, origin->vg))) { stack; diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 4120d42b3..47d874418 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -762,7 +762,7 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp) } } - if (!(lv = lv_create_empty(vg->fid, lv_name ? lv_name : "lvol%d", NULL, + if (!(lv = lv_create_empty(lv_name ? lv_name : "lvol%d", NULL, status, lp->alloc, 0, vg))) { stack; goto error; diff --git a/tools/pvmove.c b/tools/pvmove.c index 8b9b54412..5f1785d42 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -119,7 +119,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd, struct lv_list *lvl; /* FIXME Cope with non-contiguous => splitting existing segments */ - if (!(lv_mirr = lv_create_empty(vg->fid, "pvmove%d", NULL, + if (!(lv_mirr = lv_create_empty("pvmove%d", NULL, LVM_READ | LVM_WRITE, ALLOC_CONTIGUOUS, 0, vg))) { log_error("Creation of temporary pvmove LV failed"); diff --git a/tools/toollib.c b/tools/toollib.c index 83c83c31b..6a9e911e2 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -1347,7 +1347,7 @@ struct logical_volume *create_mirror_log(struct cmd_context *cmd, return NULL; } - if (!(log_lv = lv_create_empty(vg->fid, log_name, NULL, + if (!(log_lv = lv_create_empty(log_name, NULL, VISIBLE_LV | LVM_READ | LVM_WRITE, alloc, 0, vg))) { stack;