From 8fd14f09e2439650b1429ee3805305d2a4f97113 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Thu, 11 Oct 2007 18:51:21 +0000 Subject: [PATCH] Non-functional change - refactor vg_add_snapshot fid parameter. --- lib/format1/import-export.c | 2 +- lib/metadata/metadata-exported.h | 2 +- lib/metadata/snapshot_manip.c | 3 ++- lib/snapshot/snapshot.c | 2 +- tools/lvconvert.c | 2 +- tools/lvcreate.c | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c index 0966f11c2..791a5cd3f 100644 --- a/lib/format1/import-export.c +++ b/lib/format1/import-export.c @@ -644,7 +644,7 @@ int import_snapshots(struct dm_pool *mem __attribute((unused)), struct volume_gr 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."); diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 3c1eb6604..70d42ee6a 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -412,7 +412,7 @@ struct lv_segment *find_cow(const struct logical_volume *lv); /* 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); diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index 7edceee6e..4892334b7 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -48,11 +48,12 @@ struct logical_volume *origin_from_cow(const struct logical_volume *lv) 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; diff --git a/lib/snapshot/snapshot.c b/lib/snapshot/snapshot.c index 97f0ce8c1..62d2b0930 100644 --- a/lib/snapshot/snapshot.c +++ b/lib/snapshot/snapshot.c @@ -69,7 +69,7 @@ static int _snap_text_import(struct lv_segment *seg, const struct config_node *s 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; diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 19ea078ce..2f3ce1058 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -515,7 +515,7 @@ static int lvconvert_snapshot(struct cmd_context *cmd, 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; diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 6f8925492..4120d42b3 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -853,7 +853,7 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp) /* 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; -- 2.43.5