summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-12-25 00:29:30 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2017-01-03 14:55:16 +0100
commit1f5dde38a7ec18d86c38c0b7e1cb2a953ea5cf44 (patch)
treef01679ac06013332ad7387c4862b4a9da2cf798e
parentdc5bb12956d11f84352d45c69805570fc64ba66e (diff)
downloadlvm2-1f5dde38a7ec18d86c38c0b7e1cb2a953ea5cf44.tar.gz
cleanup: more use of lvseg_name
Use existing function lvseg_name().
-rw-r--r--lib/activate/activate.c2
-rw-r--r--lib/activate/dev_manager.c2
-rw-r--r--lib/format1/import-export.c2
-rw-r--r--lib/metadata/cache_manip.c2
-rw-r--r--lib/metadata/lv_manip.c2
-rw-r--r--lib/metadata/raid_manip.c11
-rw-r--r--tools/lvchange.c2
7 files changed, 7 insertions, 16 deletions
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 742d83838..608611f24 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1940,7 +1940,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
/* FIXME specify events */
if (!monitor_fn(seg, 0)) {
log_error("%s: %s segment monitoring function failed.",
- display_lvname(lv), seg->segtype->name);
+ display_lvname(lv), lvseg_name(seg));
return 0;
}
} else
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 685c0552b..6df254a20 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -2493,7 +2493,7 @@ static int _add_target_to_dtree(struct dev_manager *dm,
if (!seg->segtype->ops->add_target_line) {
log_error(INTERNAL_ERROR "_emit_target cannot handle "
- "segment type %s.", seg->segtype->name);
+ "segment type %s.", lvseg_name(seg));
return 0;
}
diff --git a/lib/format1/import-export.c b/lib/format1/import-export.c
index 146623e80..c17403127 100644
--- a/lib/format1/import-export.c
+++ b/lib/format1/import-export.c
@@ -398,7 +398,7 @@ int export_extents(struct disk_list *dl, uint32_t lv_num,
if (!(seg->segtype->flags & SEG_FORMAT1_SUPPORT)) {
log_error("Segment type %s in LV %s: "
"unsupported by format1",
- seg->segtype->name, lv->name);
+ lvseg_name(seg), lv->name);
return 0;
}
if (seg_type(seg, s) != AREA_PV) {
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index cddaf8252..aee3db8af 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -326,7 +326,7 @@ int validate_lv_cache_create_origin(const struct logical_volume *origin_lv)
lv_is_cow(origin_lv) || lv_is_merging_cow(origin_lv) ||
lv_is_virtual(origin_lv)) {
log_error("Cache is not supported with %s segment type of the original logical volume %s.",
- first_seg(origin_lv)->segtype->name, display_lvname(origin_lv));
+ lvseg_name(first_seg(origin_lv)), display_lvname(origin_lv));
return 0;
}
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index e94851231..9759cda1d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4596,7 +4596,7 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv,
if (!policy_amount) {
log_error("Can't extend %s with %s autoextend percent set to 0%%.",
- display_lvname(lv), first_seg(lv)->segtype->name);
+ display_lvname(lv), lvseg_name(first_seg(lv)));
return 0;
}
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 5ec86a38a..bceff79b9 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2724,15 +2724,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;
@@ -2753,7 +2744,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" : "");
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 250d7209b..9fec43636 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -431,7 +431,7 @@ static int _lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
/* Separate mirror log or metadata devices so we can clear them */
if (!detach_metadata_devices(seg, &device_list)) {
log_error("Failed to clear %s %s for %s.",
- seg->segtype->name, seg_is_raid(seg) ?
+ lvseg_name(seg), seg_is_raid(seg) ?
"metadata area" : "mirror log", display_lvname(lv));
return 0;
}