From 84801d7c34430052e298bc54826e18eb68212ec6 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Tue, 23 Jul 2013 13:33:14 +0100 Subject: [PATCH] thin: rename extend_pool to create_pool --- lib/metadata/lv_manip.c | 2 +- lib/metadata/metadata.h | 2 +- lib/metadata/thin_manip.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 16ad7e753..8882a0afa 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -2868,7 +2868,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, stripes, stripe_size))) + if (!(r = create_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 c2a20cb6a..2408c2390 100644 --- a/lib/metadata/metadata.h +++ b/lib/metadata/metadata.h @@ -470,7 +470,7 @@ int attach_pool_message(struct lv_segment *pool_seg, dm_thin_message_t type, int pool_has_message(const struct lv_segment *seg, const struct logical_volume *lv, uint32_t device_id); int pool_below_threshold(const struct lv_segment *pool_seg); -int extend_pool(struct logical_volume *lv, const struct segment_type *segtype, +int create_pool(struct logical_volume *lv, const struct segment_type *segtype, struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size); /* diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 38073ee63..35e1ec709 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -425,8 +425,7 @@ uint32_t get_free_pool_device_id(struct lv_segment *thin_pool_seg) return max_id; } -// FIXME Rename this fn: it doesn't extend an already-existing pool AFAICT -int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segtype, +int create_pool(struct logical_volume *pool_lv, const struct segment_type *segtype, struct alloc_handle *ah, uint32_t stripes, uint32_t stripe_size) { const struct segment_type *striped; @@ -455,7 +454,9 @@ int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segty if (!lv_add_segment(ah, stripes, 1, pool_lv, striped, 1, 0, 0)) return_0; - if (activation()) { + if (!activation()) + log_warn("WARNING: Pool %s is created without initialization.", pool_lv->name); + else { if (!vg_write(pool_lv->vg) || !vg_commit(pool_lv->vg)) return_0; @@ -474,8 +475,6 @@ int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segty pool_lv->name); goto bad; } - } else { - log_warn("WARNING: Pool %s is created without initialization.", pool_lv->name); } if (dm_snprintf(name, sizeof(name), "%s_tmeta", pool_lv->name) < 0) { @@ -512,6 +511,7 @@ int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segty goto_bad; return 1; + bad: if (activation()) { if (deactivate_lv_local(pool_lv->vg->cmd, pool_lv)) {