diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2012-09-05 11:35:54 -0500 |
---|---|---|
committer | Jonathan Brassow <jbrassow@redhat.com> | 2012-09-05 11:35:54 -0500 |
commit | c3eb3a76875ccf8c544c991bc52b6b3061bf8f58 (patch) | |
tree | 13c75423be2ee31d2b69731cdfad8b14eaef4ded /tools | |
parent | 1b01a2f65a27b95717fa7b6d912271e330782873 (diff) | |
download | lvm2-c3eb3a76875ccf8c544c991bc52b6b3061bf8f58.tar.gz lvm2-c3eb3a76875ccf8c544c991bc52b6b3061bf8f58.tar.xz lvm2-c3eb3a76875ccf8c544c991bc52b6b3061bf8f58.zip |
cleanup: Use segtype->ops->name() instead of segtype->name where applicable
When printing a message for the user and the lv_segment pointer is available,
use segtype->ops->name() instead of segtype->name. This gives a better
user-readable name for the segment. This is especially true for the
'striped' segment type, which prints "linear" if there is an area_count of
one.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lvconvert.c | 4 | ||||
-rw-r--r-- | tools/lvresize.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c index ddda2f19..7b284f07 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1577,14 +1577,14 @@ static int lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp if (arg_count(cmd, mirrors_ARG) && !seg_is_mirrored(seg) && !seg_is_linear(seg)) { log_error("'--mirrors/-m' is not compatible with %s", - seg->segtype->name); + seg->segtype->ops->name(seg)); return 0; } if (!is_valid_raid_conversion(seg->segtype, lp->segtype)) { log_error("Unable to convert %s/%s from %s to %s", lv->vg->name, lv->name, - seg->segtype->name, lp->segtype->name); + seg->segtype->ops->name(seg), lp->segtype->name); return 0; } diff --git a/tools/lvresize.c b/tools/lvresize.c index 5052bfbc..18e5917f 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -630,7 +630,7 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg, lp->stripes = seg_stripes; else if (seg_is_raid(first_seg(lv)) && (lp->stripes != seg_stripes)) { - log_error("Unable to extend \"%s\" segment type with different number of stripes.", first_seg(lv)->segtype->name); + log_error("Unable to extend \"%s\" segment type with different number of stripes.", first_seg(lv)->segtype->ops->name(first_seg(lv))); return ECMD_FAILED; } |