mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Non-functional change - refactor lv_create_empty().
Remove struct format_instance param - we can safely obtain this from vg->fid inside the function.
This commit is contained in:
parent
8fd14f09e2
commit
9ea1d647af
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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. "
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user