From f0da2842cfec05753154e5516f01e0dfd7331640 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 2 Dec 2012 16:27:39 +0100 Subject: [PATCH] thin: shuffle code Reorder code lines for next patch. --- tools/lvconvert.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 76588d2ac..a75a7fc3c 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1917,12 +1917,6 @@ static int _lvconvert_thinpool(struct cmd_context *cmd, return 0; } - /* Rename deactivated metadata LV to have _tmeta suffix */ - /* Implicit checks if metadata_lv is visible */ - if (strcmp(metadata_lv->name, name) && - !lv_rename_update(cmd, metadata_lv, name, 0)) - return_0; - /* * Since we wish to have underlaying dev, to match _tdata * rename data LV first, also checks for visible LV @@ -1940,18 +1934,24 @@ static int _lvconvert_thinpool(struct cmd_context *cmd, seg->segtype = lp->segtype; seg->lv->status |= THIN_POOL; - seg->chunk_size = lp->chunk_size; - seg->zero_new_blocks = lp->zero ? 1 : 0; - seg->discards = lp->discards; + /* Drop reference as attach_pool_data_lv() takes it again */ + remove_seg_from_segs_using_this_lv(data_lv, seg); + if (!attach_pool_data_lv(seg, data_lv)) + return_0; + seg->low_water_mark = 0; seg->transaction_id = 0; + seg->chunk_size = lp->chunk_size; + seg->discards = lp->discards; + seg->zero_new_blocks = lp->zero ? 1 : 0; - if (!attach_pool_metadata_lv(seg, metadata_lv)) + /* Rename deactivated metadata LV to have _tmeta suffix */ + /* Implicit checks if metadata_lv is visible */ + if (strcmp(metadata_lv->name, name) && + !lv_rename_update(cmd, metadata_lv, name, 0)) return_0; - /* Drop reference as attach_pool_data_lv() takes it again */ - remove_seg_from_segs_using_this_lv(data_lv, seg); - if (!attach_pool_data_lv(seg, data_lv)) + if (!attach_pool_metadata_lv(seg, metadata_lv)) return_0; if (!vg_write(pool_lv->vg) || !vg_commit(pool_lv->vg)) -- 2.43.5