From 15db9fcfbf2f3cdf141f11cc142c10787d82e20a Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 3 May 2005 17:28:23 +0000 Subject: Reinstate full PV size when removing from VG. Support loopfiles for testing. Complete the pv_segment support. --- lib/striped/striped.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/striped') diff --git a/lib/striped/striped.c b/lib/striped/striped.c index ccd369d38..dd95454df 100644 --- a/lib/striped/striped.c +++ b/lib/striped/striped.c @@ -26,6 +26,7 @@ #include "targets.h" #include "lvm-string.h" #include "activate.h" +#include "pv_alloc.h" static const char *_name(const struct lv_segment *seg) { @@ -118,8 +119,10 @@ static int _segments_compatible(struct lv_segment *first, width = first->area_len; - if ((first->area[s].u.pv.pv != second->area[s].u.pv.pv) || - (first->area[s].u.pv.pe + width != second->area[s].u.pv.pe)) + if ((first->area[s].u.pv.pvseg->pv != + second->area[s].u.pv.pvseg->pv) || + (first->area[s].u.pv.pvseg->pe + width != + second->area[s].u.pv.pvseg->pe)) return 0; } @@ -131,12 +134,19 @@ static int _segments_compatible(struct lv_segment *first, static int _merge_segments(struct lv_segment *seg1, struct lv_segment *seg2) { + uint32_t s; + if (!_segments_compatible(seg1, seg2)) return 0; seg1->len += seg2->len; seg1->area_len += seg2->area_len; + for (s = 0; s < seg1->area_count; s++) + if (seg1->area[s].type == AREA_PV) + merge_pv_segments(seg1->area[s].u.pv.pvseg, + seg2->area[s].u.pv.pvseg); + return 1; } -- cgit v1.2.1