From 3b3948f1d2dc3ba38148a6409f427db4ce456cb7 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 22 Aug 2007 20:03:46 +0000 Subject: [PATCH] Change lvconvert_mirrors to use mirror segtype not striped. --- WHATS_NEW | 1 + tools/lvconvert.c | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index d4f7de2e0..ceb5b7360 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.28 - ================================ + Change lvconvert_mirrors to use mirror segtype not striped. Fix lvconvert_mirrors detection of number of existing mirrors. Clean up numerous compiler warnings that crept in recently. Remove several unused parameters from _allocate(). diff --git a/tools/lvconvert.c b/tools/lvconvert.c index bce79e690..76a7bfb54 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -208,7 +208,7 @@ static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd, return 0; } - if (!(lp->segtype = get_segtype_from_string(cmd, "striped"))) + if (!(lp->segtype = get_segtype_from_string(cmd, "mirror"))) return_0; } @@ -236,7 +236,6 @@ static int lvconvert_mirrors(struct cmd_context * cmd, struct logical_volume * l struct alloc_handle *ah = NULL; struct logical_volume *log_lv; struct list *parallel_areas; - struct segment_type *segtype; /* FIXME: could I just use lp->segtype */ float sync_percent; const char *mirrorlog; unsigned corelog = 0; @@ -339,7 +338,7 @@ static int lvconvert_mirrors(struct cmd_context * cmd, struct logical_volume * l if (!(ah = allocate_extents(lv->vg, NULL, lp->segtype, 1, lp->mirrors - 1, corelog ? 0U : 1U, - lv->le_count * (lp->mirrors - 1), + lv->le_count, NULL, 0, lp->pvh, lp->alloc, parallel_areas))) @@ -386,9 +385,7 @@ static int lvconvert_mirrors(struct cmd_context * cmd, struct logical_volume * l return 0; } - segtype = get_segtype_from_string(cmd, "striped"); - - if (!(ah = allocate_extents(lv->vg, NULL, segtype, 0, + if (!(ah = allocate_extents(lv->vg, NULL, lp->segtype, 0, 0, 1, 0, NULL, 0, lp->pvh, lp->alloc,