From 7e92535d475da7403f2ec8eeb2c5af6209fa2ba8 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 3 Feb 2017 22:16:00 +0100 Subject: [PATCH] lvconvert: add segtype raid5_n and conversions to/from it Change: - missed a return_0 - use lvseg_name() rather than my own function Related: rhbz1366296 --- lib/metadata/raid_manip.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index f845164b1..3543a6917 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -2227,7 +2227,7 @@ static int _convert_raid1_to_mirror(struct logical_volume *lv, log_debug_metadata("Changing image count to %u on %s.", new_image_count, display_lvname(lv)); if (!_lv_raid_change_image_count(lv, new_image_count, allocate_pvs, removal_lvs, 0, 0)) - return 0; + return_0; } /* Remove rmeta LVs */ @@ -2703,15 +2703,6 @@ static const char *_get_segtype_alias(const struct segment_type *segtype) return ""; } -/* Return "linear" for striped segtype with 1 area instead of "striped" */ -static const char *_get_segtype_name(const struct segment_type *segtype, unsigned new_image_count) -{ - if (!segtype || (segtype_is_striped(segtype) && new_image_count == 1)) - return "linear"; - - return segtype->name; -} - static int _log_possible_conversion_types(const struct logical_volume *lv, const struct segment_type *new_segtype) { unsigned possible_conversions = 0; @@ -2732,7 +2723,7 @@ static int _log_possible_conversion_types(const struct logical_volume *lv, const log_error("Converting %s from %s%s%s%s is " "directly possible to the following layout%s:", - display_lvname(lv), _get_segtype_name(seg->segtype, seg->area_count), + display_lvname(lv), lvseg_name(seg), *alias ? " (same as " : "", alias, *alias ? ")" : "", possible_conversions > 1 ? "s" : ""); -- 2.43.5