summaryrefslogtreecommitdiff
path: root/lib/striped
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2005-05-03 17:28:23 +0000
committerAlasdair Kergon <agk@redhat.com>2005-05-03 17:28:23 +0000
commit15db9fcfbf2f3cdf141f11cc142c10787d82e20a (patch)
treefeab5b65e91aa76105f938f29715baa7e1543f9b /lib/striped
parent1d76599a94006cc22f51479d69b70f6d67704796 (diff)
downloadlvm2-15db9fcfbf2f3cdf141f11cc142c10787d82e20a.tar.gz
Reinstate full PV size when removing from VG.
Support loopfiles for testing. Complete the pv_segment support.
Diffstat (limited to 'lib/striped')
-rw-r--r--lib/striped/striped.c14
1 files changed, 12 insertions, 2 deletions
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;
}