mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-11 09:18:25 +03:00
Avoid ambigous volume_group argument in vg_add_snapshot()
This commit is contained in:
parent
10d91d213f
commit
08442ab71e
@ -620,8 +620,7 @@ int import_snapshots(struct pool *mem, struct volume_group *vg,
|
||||
continue;
|
||||
|
||||
/* insert the snapshot */
|
||||
if (!vg_add_snapshot(vg, org, cow, 1,
|
||||
lvd->lv_chunk_size)) {
|
||||
if (!vg_add_snapshot(org, cow, 1, lvd->lv_chunk_size)) {
|
||||
log_err("Couldn't add snapshot.");
|
||||
return 0;
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ static int _read_snapshot(struct pool *mem,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!vg_add_snapshot(vg, org, cow, 1, chunk_size)) {
|
||||
if (!vg_add_snapshot(org, cow, 1, chunk_size)) {
|
||||
stack;
|
||||
return 0;
|
||||
}
|
||||
|
@ -340,8 +340,7 @@ int lv_is_cow(struct logical_volume *lv);
|
||||
|
||||
struct snapshot *find_cow(struct volume_group *vg, struct logical_volume *lv);
|
||||
|
||||
int vg_add_snapshot(struct volume_group *vg,
|
||||
struct logical_volume *origin,
|
||||
int vg_add_snapshot(struct logical_volume *origin,
|
||||
struct logical_volume *cow,
|
||||
int persistent,
|
||||
uint32_t chunk_size);
|
||||
|
@ -50,15 +50,14 @@ struct snapshot *find_cow(struct volume_group *vg, struct logical_volume *lv)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int vg_add_snapshot(struct volume_group *vg,
|
||||
struct logical_volume *origin,
|
||||
int vg_add_snapshot(struct logical_volume *origin,
|
||||
struct logical_volume *cow,
|
||||
int persistent,
|
||||
uint32_t chunk_size)
|
||||
{
|
||||
struct snapshot *s;
|
||||
struct snapshot_list *sl;
|
||||
struct pool *mem = vg->cmd->mem;
|
||||
struct pool *mem = origin->vg->cmd->mem;
|
||||
|
||||
/*
|
||||
* Is the cow device already being used ?
|
||||
@ -85,7 +84,7 @@ int vg_add_snapshot(struct volume_group *vg,
|
||||
}
|
||||
|
||||
sl->snapshot = s;
|
||||
list_add(&vg->snapshots, &sl->list);
|
||||
list_add(&origin->vg->snapshots, &sl->list);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp,
|
||||
vg, pvh)))
|
||||
return 0;
|
||||
|
||||
if (lp->snapshot && !vg_add_snapshot(vg, org, lv, 1, lp->chunk_size)) {
|
||||
if (lp->snapshot && !vg_add_snapshot(org, lv, 1, lp->chunk_size)) {
|
||||
log_err("Couldn't create snapshot.");
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user