Skip to contentSkip to conversation

master - lvconvert: add infrastructure for RaidLV reshaping support

PATCH Heinz Mauelshagen 1 participant 1 message Feb 24, 2017 MD RAID

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=92691e345d12515d61e6e7748e5b9ddc4eff49c0
Commit:        92691e345d12515d61e6e7748e5b9ddc4eff49c0
Parent:        c1865b0a864e0623b2395c96e7853e4637e46772
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Fri Feb 24 01:57:04 2017 +0100
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Fri Feb 24 05:20:58 2017 +0100

lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change of LV type, stripesize or number of legs), this patch introduces more local infrastructure to raid_manip.c used by followup patches.

Changes:
- add lv_raid_data_copies returning raid type specific number; needed for raid10 with more than 2 data copies
- remove _shift_and_rename_image_components() constraint
to support more than 10 raid legs
- add function to calculate total rimage length used by out-of-place reshape space allocation
- add out-of-place reshape space alloc/relocate/free functions
- move _data_rimages_count() used by reshape space alloc/realocate functions

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

---
 lib/metadata/lv_manip.c   |    2 +-
 lib/metadata/raid_manip.c |  470 ++++++++++++++++++++++++++++++++++++++++++---
 lib/raid/raid.c           |    2 +-
 3 files changed, 443 insertions(+), 31 deletions(-)
lib/metadata/lv_manip.c +1 -1
index f3cad09..b98391b 100644
@@ -957,7 +957,7 @@ struct lv_segment *alloc_lv_segment(const struct segment_type *segtype,
 	seg->stripe_size = stripe_size;
 	seg->area_count = area_count;
 	seg->area_len = area_len;
-	seg->data_copies = data_copies ? : 0; // lv_raid_data_copies(segtype, area_count);
+	seg->data_copies = data_copies ? : lv_raid_data_copies(segtype, area_count);
 	seg->chunk_size = chunk_size;
 	seg->region_size = region_size;
 	seg->extents_copied = extents_copied;
lib/metadata/raid_manip.c +441 -29

516 lines not on this page · raw message

lib/raid/raid.c +1 -1
index 398e8b0..59db437 100644
@@ -171,7 +171,7 @@ static int _raid_text_import(struct lv_segment *seg,
 	}
 
 	if (seg->data_copies < 2)
-		seg->data_copies = 0; // lv_raid_data_copies(seg->segtype, seg->area_count);
+		seg->data_copies = lv_raid_data_copies(seg->segtype, seg->area_count);
 
 	if (seg_is_any_raid0(seg))
 		seg->area_len /= seg->area_count;