From 34d22f7047adb277c526c6e45b2d039c342ae581 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 18 Jan 2008 22:00:46 +0000 Subject: [PATCH] add lvconvert messages --- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 26 +++++++++++++++++++++++++- lib/metadata/mirror.c | 5 +++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 7a74fe2d1..67c30552f 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.31 - =================================== + Add very_verbose lvconvert messages. Avoid error message when using default setting of lvcreate -M1. (2.02.30) Version 2.02.30 - 17th January 2008 diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 0aab13828..8dcfb3c79 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -43,6 +43,9 @@ int add_seg_to_segs_using_this_lv(struct logical_volume *lv, } } + log_very_verbose("Adding %s:%" PRIu32 " as an user of %s", + seg->lv->name, seg->le, lv->name); + if (!(sl = dm_pool_zalloc(lv->vg->cmd->mem, sizeof(*sl)))) { log_error("Failed to allocate segment list"); return 0; @@ -65,8 +68,12 @@ int remove_seg_from_segs_using_this_lv(struct logical_volume *lv, continue; if (sl->count > 1) sl->count--; - else + else { + log_very_verbose("%s:%" PRIu32 " is no longer a user " + "of %s", seg->lv->name, seg->le, + lv->name); list_del(&sl->list); + } return 1; } @@ -255,6 +262,11 @@ void release_lv_segment_area(struct lv_segment *seg, uint32_t s, } if (area_reduction == seg->area_len) { + log_very_verbose("Remove %s:%" PRIu32 "[%" PRIu32 "] from " + "the top of LV %s:%" PRIu32, + seg->lv->name, seg->le, s, + seg_lv(seg, s)->name, seg_le(seg, s)); + remove_seg_from_segs_using_this_lv(seg_lv(seg, s), seg); seg_lv(seg, s) = NULL; seg_le(seg, s) = 0; @@ -332,6 +344,9 @@ int set_lv_segment_area_lv(struct lv_segment *seg, uint32_t area_num, struct logical_volume *lv, uint32_t le, uint32_t flags) { + log_very_verbose("Stack %s:%" PRIu32 "[%" PRIu32 "] on LV %s:%" PRIu32, + seg->lv->name, seg->le, area_num, lv->name, le); + seg->areas[area_num].type = AREA_LV; seg_lv(seg, area_num) = lv; seg_le(seg, area_num) = le; @@ -2177,6 +2192,9 @@ int remove_layers_for_segments(struct cmd_context *cmd, int lv_changed = 0; struct lv_list *lvl; + log_very_verbose("Removing layer %s for segments of %s", + layer_lv->name, lv->name); + /* Find all segments that point at the temporary mirror */ list_iterate_items(seg, &lv->segments) { for (s = 0; s < seg->area_count; s++) { @@ -2313,6 +2331,8 @@ int remove_layer_from_lv(struct logical_volume *lv, struct lv_segment *parent_seg; struct segment_type *segtype; + log_very_verbose("Removing layer %s for %s", layer_lv->name, lv->name); + if (!(parent_seg = get_only_segment_using_this_lv(layer_lv))) { log_error("Failed to find layer %s in %s", layer_lv->name, lv->name); @@ -2569,6 +2589,10 @@ int insert_layer_for_segments_on_pv(struct cmd_context *cmd, int lv_used = 0; uint32_t s; + log_very_verbose("Inserting layer %s for segments of %s on %s", + layer_lv->name, lv_where->name, + pvl ? pv_dev_name(pvl->pv) : "any"); + if (!_align_segment_boundary_to_pe_range(lv_where, pvl)) return_0; diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 8cb79c521..4b299329a 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -516,6 +516,8 @@ static int _remove_mirror_images(struct logical_volume *lv, return 0; } } else if (new_area_count == 0) { + log_very_verbose("All mimages of %s are gone", lv->name); + /* All mirror images are gone. * It can happen for vgreduce --removemissing. */ _remove_mirror_log(mirrored_seg); @@ -586,6 +588,9 @@ static int _remove_mirror_images(struct logical_volume *lv, if (removed) *removed = old_area_count - new_area_count; + log_very_verbose("%" PRIu32 " image(s) removed from %s", + old_area_count - num_removed, lv->name); + return 1; }