1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00

cleanup: use directly segtype->name

Simplify printing of segtype name.
This commit is contained in:
Zdenek Kabelac 2014-05-23 14:24:46 +02:00
parent 952514611d
commit bf6b69c46b
2 changed files with 10 additions and 26 deletions

View File

@ -6116,7 +6116,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
*/
log_error("Can't create %s without using "
"device-mapper kernel driver.",
seg_is_thin_pool(lp) ? "thin pool volume" :
lp->segtype->name);
return NULL;
}

View File

@ -194,35 +194,23 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
if (seg_is_pool(seg)) {
if (seg->area_count != 1 ||
seg_type(seg, 0) != AREA_LV) {
log_error("LV %s: %spool segment %u is missing a pool data LV",
lv->name,
seg_is_thin_pool(seg) ?
"thin " : "cache",
seg_count);
log_error("LV %s: %s segment %u is missing a pool data LV",
lv->name, seg->segtype->name, seg_count);
inc_error_count;
} else if (!(seg2 = first_seg(seg_lv(seg, 0))) || find_pool_seg(seg2) != seg) {
log_error("LV %s: %spool segment %u data LV does not refer back to pool LV",
lv->name,
seg_is_thin_pool(seg) ?
"thin " : "cache",
seg_count);
log_error("LV %s: %s segment %u data LV does not refer back to pool LV",
lv->name, seg->segtype->name, seg_count);
inc_error_count;
}
if (!seg->metadata_lv) {
log_error("LV %s: %spool segment %u is missing a pool metadata LV",
lv->name,
seg_is_thin_pool(seg) ?
"thin " : "cache",
seg_count);
log_error("LV %s: %s segment %u is missing a pool metadata LV",
lv->name, seg->segtype->name, seg_count);
inc_error_count;
} else if (!(seg2 = first_seg(seg->metadata_lv)) ||
find_pool_seg(seg2) != seg) {
log_error("LV %s: %spool segment %u metadata LV does not refer back to pool LV",
lv->name,
seg_is_thin_pool(seg) ?
"thin " : "cache",
seg_count);
log_error("LV %s: %s segment %u metadata LV does not refer back to pool LV",
lv->name, seg->segtype->name, seg_count);
inc_error_count;
}
@ -232,11 +220,8 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
(seg_is_cache_pool(seg) &&
((seg->chunk_size < DM_CACHE_MIN_DATA_BLOCK_SIZE) ||
(seg->chunk_size > DM_CACHE_MAX_DATA_BLOCK_SIZE)))) {
log_error("LV %s: %spool segment %u has chunk size %u out of range.",
lv->name,
seg_is_thin_pool(seg) ?
"thin " : "cache",
seg_count, seg->chunk_size);
log_error("LV %s: %s segment %u has chunk size %u out of range.",
lv->name, seg->segtype->name, seg_count, seg->chunk_size);
inc_error_count;
}
} else {