From 1ff53bb7b682a13e32d986e53a40eeb8fb5e47c4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 22 Nov 2013 18:19:13 +0100 Subject: [PATCH] snapshot: code move Move some code lines in front, they will be shared with thin snapshot merge later. --- lib/metadata/snapshot_manip.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index c491918f9..3e90f3ed5 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -154,6 +154,10 @@ void init_snapshot_seg(struct lv_segment *seg, struct logical_volume *origin, void init_snapshot_merge(struct lv_segment *snap_seg, struct logical_volume *origin) { + snap_seg->status |= MERGING; + origin->snapshot = snap_seg; + origin->status |= MERGING; + /* * Even though lv_is_visible(snap_seg->lv) returns 0, * the snap_seg->lv (name: snapshotX) is _not_ hidden; @@ -165,9 +169,6 @@ void init_snapshot_merge(struct lv_segment *snap_seg, * merge metadata (snap_seg->lv is now "internal") */ snap_seg->lv->status &= ~VISIBLE_LV; - snap_seg->status |= MERGING; - origin->snapshot = snap_seg; - origin->status |= MERGING; } void clear_snapshot_merge(struct logical_volume *origin)