From bfa258b3e7689f7c6da3fc5035e36b3cf3b85bc0 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 24 May 2004 17:30:00 +0000 Subject: [PATCH] Set area_count within alloc_lv_segment --- WHATS_NEW | 1 + lib/format1/import-extents.c | 2 -- lib/format_text/import_vsn1.c | 1 - lib/metadata/lv_manip.c | 5 +---- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 52d4ea366..dd9f4f747 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.00.16 - ============================= + Set area_count within alloc_lv_segment. Remove error labels from lvresize. Fix a pvs error path. xxchange -ae for exclusive activation. diff --git a/lib/format1/import-extents.c b/lib/format1/import-extents.c index 851e7c251..93225f5bb 100644 --- a/lib/format1/import-extents.c +++ b/lib/format1/import-extents.c @@ -221,7 +221,6 @@ static int _read_linear(struct cmd_context *cmd, struct lv_map *lvm) seg->len = 0; seg->area_len = 0; seg->stripe_size = 0; - seg->area_count = 1; seg->area[0].type = AREA_PV; seg->area[0].u.pv.pv = lvm->map[le].pv; @@ -289,7 +288,6 @@ static int _read_stripes(struct cmd_context *cmd, struct lv_map *lvm) return 0; } seg->stripe_size = lvm->stripe_size; - seg->area_count = lvm->stripes; seg->le = seg->area_count * le; seg->len = 1; seg->area_len = 1; diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c index a84848114..cccf448a7 100644 --- a/lib/format_text/import_vsn1.c +++ b/lib/format_text/import_vsn1.c @@ -295,7 +295,6 @@ static int _read_segment(struct pool *mem, struct volume_group *vg, seg->status = 0u; seg->segtype = segtype; seg->extents_copied = 0u; - seg->area_count = area_count; if (seg->segtype->ops->text_import && !seg->segtype->ops->text_import(seg, sn, pv_hash)) { diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 9c70dcdc9..3fc3d985d 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -71,6 +71,7 @@ struct lv_segment *alloc_lv_segment(struct pool *mem, uint32_t num_areas) return NULL; } + seg->area_count = num_areas; list_init(&seg->tags); return seg; @@ -107,7 +108,6 @@ static int _alloc_parallel_area(struct logical_volume *lv, uint32_t area_count, seg->le = *ix; seg->len = area_len * (striped ? area_count : 1); seg->area_len = area_len; - seg->area_count = area_count; seg->stripe_size = stripe_size; seg->extents_copied = 0u; @@ -241,7 +241,6 @@ static int _alloc_linear_area(struct logical_volume *lv, uint32_t *ix, seg->len = count; seg->area_len = count; seg->stripe_size = 0; - seg->area_count = 1; seg->area[0].type = AREA_PV; seg->area[0].u.pv.pv = map->pvl->pv; seg->area[0].u.pv.pe = pva->start; @@ -279,7 +278,6 @@ static int _alloc_mirrored_area(struct logical_volume *lv, uint32_t *ix, seg->len = count; seg->area_len = count; seg->stripe_size = 0; - seg->area_count = 2; seg->extents_copied = 0u; /* FIXME Remove AREA_PV restriction here? */ seg->area[0].type = AREA_PV; @@ -435,7 +433,6 @@ static int _alloc_virtual(struct logical_volume *lv, seg->len = lv->le_count - allocated; seg->area_len = seg->len; seg->stripe_size = 0; - seg->area_count = 0; seg->extents_copied = 0u; list_add(&lv->segments, &seg->list); lv->status |= VIRTUAL;