continue;
/* insert the snapshot */
- if (!vg_add_snapshot(vg->fid, NULL, org, cow, NULL,
+ if (!vg_add_snapshot(vg, NULL, org, cow, NULL,
org->le_count,
lvd->lv_chunk_size)) {
log_err("Couldn't add snapshot.");
/* Given a cow LV, return its origin */
struct logical_volume *origin_from_cow(const struct logical_volume *lv);
-int vg_add_snapshot(struct format_instance *fid, const char *name,
+int vg_add_snapshot(struct volume_group *vg, const char *name,
struct logical_volume *origin, struct logical_volume *cow,
union lvid *lvid, uint32_t extent_count,
uint32_t chunk_size);
return lv->snapshot->origin;
}
-int vg_add_snapshot(struct format_instance *fid, const char *name,
+int vg_add_snapshot(struct volume_group *vg, const char *name,
struct logical_volume *origin,
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;
return 0;
}
- if (!vg_add_snapshot(seg->lv->vg->fid, seg->lv->name, org, cow,
+ if (!vg_add_snapshot(seg->lv->vg, seg->lv->name, org, cow,
&seg->lv->lvid, seg->len, chunk_size)) {
stack;
return 0;
return 0;
}
- if (!vg_add_snapshot(lv->vg->fid, NULL, org, lv, NULL, org->le_count,
+ if (!vg_add_snapshot(lv->vg, NULL, org, lv, NULL, org->le_count,
lp->chunk_size)) {
log_error("Couldn't create snapshot.");
return 0;
/* cow LV remains active and becomes snapshot LV */
- if (!vg_add_snapshot(vg->fid, NULL, org, lv, NULL,
+ if (!vg_add_snapshot(vg, NULL, org, lv, NULL,
org->le_count, lp->chunk_size)) {
log_err("Couldn't create snapshot.");
return 0;