diff options
author | Mike Snitzer <snitzer@redhat.com> | 2010-01-13 01:55:43 +0000 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2010-01-13 01:55:43 +0000 |
commit | c79b425135d27f0f1e280e30e0984a8e88216e92 (patch) | |
tree | fb992f15289713f2c8f18206912dc0b32537ed8b /tools/lvconvert.c | |
parent | a39ac3e11b7d37584e7da0bdb93d7db834e1c36a (diff) | |
download | lvm2-c79b425135d27f0f1e280e30e0984a8e88216e92.tar.gz lvm2-c79b425135d27f0f1e280e30e0984a8e88216e92.tar.xz lvm2-c79b425135d27f0f1e280e30e0984a8e88216e92.zip |
Add snapshot merge wrappers to abstract the associations and flags used
to represent merging origin and snapshot volumes.
Diffstat (limited to 'tools/lvconvert.c')
-rw-r--r-- | tools/lvconvert.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c index b591284a..8c142a3d 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -377,7 +377,7 @@ static int _finish_lvconvert_merge(struct cmd_context *cmd, struct logical_volume *lv, struct dm_list *lvs_changed __attribute((unused))) { - struct lv_segment *snap_seg = lv->merging_snapshot; + struct lv_segment *snap_seg = find_merging_cow(lv); if (!snap_seg) { log_error("Logical volume %s has no merging snapshot.", lv->name); return 0; @@ -450,7 +450,7 @@ int lvconvert_poll(struct cmd_context *cmd, struct logical_volume *lv, memcpy(uuid, &lv->lvid, sizeof(lv->lvid)); - if (!lv->merging_snapshot) + if (!lv_is_merging_origin(lv)) return poll_daemon(cmd, lv_full_name, uuid, background, 0, &_lvconvert_mirror_fns, "Converted"); else @@ -1123,13 +1123,13 @@ static int lvconvert_merge(struct cmd_context *cmd, struct lvinfo info; /* Check if merge is possible */ - if (cow_seg->status & SNAPSHOT_MERGE) { + if (lv_is_merging_cow(lv)) { log_error("Snapshot %s is already merging", lv->name); return 0; } - if (origin->merging_snapshot) { + if (lv_is_merging_origin(origin)) { log_error("Snapshot %s is already merging into the origin", - origin->merging_snapshot->cow->name); + find_merging_cow(origin)->cow->name); return 0; } |