From 0968dfcd03bd4b31793352b2e49a95dbcf58fb07 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 28 Oct 2011 20:32:54 +0000 Subject: [PATCH] Thin support for stripe Support stripe options to create thin data pool LV. TODO: combine chunk size and stripe size. --- lib/metadata/lv_manip.c | 2 +- lib/metadata/metadata.h | 2 +- lib/metadata/thin_manip.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 2431751dd..688bb872d 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -2570,7 +2570,7 @@ int lv_extend(struct logical_volume *lv, if (segtype_is_thin_pool(segtype)) { if (!lv->le_count) { - if (!(r = extend_pool(lv, segtype, ah))) + if (!(r = extend_pool(lv, segtype, ah, stripes, stripe_size))) stack; } else if (!(r = _lv_extend_layered_lv(ah, lv, extents, 0, stripes, stripe_size))) diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h index 7cae0b983..87a200013 100644 --- a/lib/metadata/metadata.h +++ b/lib/metadata/metadata.h @@ -463,7 +463,7 @@ int attach_pool_message(struct lv_segment *seg, dm_thin_message_t type, int read_only); int detach_pool_messages(struct lv_segment *seg); int extend_pool(struct logical_volume *lv, const struct segment_type *segtype, - struct alloc_handle *ah); + struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size); /* * Begin skeleton for external LVM library diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index da9be06f8..ee3168e19 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -220,7 +220,7 @@ uint32_t get_free_pool_device_id(struct lv_segment *thin_pool_seg) } int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segtype, - struct alloc_handle *ah) + struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size) { const struct segment_type *striped; struct logical_volume *meta_lv, *data_lv; @@ -245,7 +245,7 @@ int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segty } /* Metadata segment */ - if (!lv_add_segment(ah, 1, 1, pool_lv, striped, 1, 0, 0)) + if (!lv_add_segment(ah, stripes, 1, pool_lv, striped, 1, 0, 0)) return_0; if (activation()) { @@ -290,7 +290,7 @@ int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segty return_0; /* Pool data segment */ - if (!lv_add_segment(ah, 0, 1, pool_lv, striped, 1, 0, 0)) + if (!lv_add_segment(ah, 0, stripes, pool_lv, striped, stripe_size, 0, 0)) return_0; if (!(data_lv = insert_layer_for_lv(pool_lv->vg->cmd, pool_lv,