mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
lv: remove lv_type_name fn
The lv_type_name function is remnant from old code that reported only single string for the LV type. LV types are now reported in a more extended way as keyword list that describe the type precisely (using lv_layout_and_type fn). The lv_type_name was used in some error messages to display the type of the LV so just reinstate the old messages back referencing the type directly with a string - this is enough for error messages. They don't need to display the LV type as precisely as it's used on lvs output (which is optimized for selection anyway).
This commit is contained in:
parent
aec4d0c939
commit
84860fd54f
@ -151,11 +151,6 @@ static const char *_lv_type_names[] = {
|
||||
[LV_TYPE_RAID_N_CONTINUE] = "n-continue",
|
||||
};
|
||||
|
||||
const char *lv_type_name(const struct logical_volume *lv)
|
||||
{
|
||||
return " ";
|
||||
}
|
||||
|
||||
static int _lv_type_list_mirror(struct dm_pool *mem,
|
||||
const struct logical_volume *lv,
|
||||
struct dm_list *layout,
|
||||
|
@ -910,9 +910,6 @@ int get_pv_list_for_lv(struct dm_pool *mem,
|
||||
struct lv_segment *first_seg(const struct logical_volume *lv);
|
||||
struct lv_segment *last_seg(const struct logical_volume *lv);
|
||||
|
||||
/* Human-readable LV type name. */
|
||||
const char *lv_type_name(const struct logical_volume *lv);
|
||||
|
||||
/*
|
||||
* Useful functions for managing snapshots.
|
||||
*/
|
||||
|
@ -2718,8 +2718,8 @@ static int _lvconvert_pool(struct cmd_context *cmd,
|
||||
}
|
||||
if (lv_is_thin_type(metadata_lv) ||
|
||||
lv_is_cache_type(metadata_lv)) {
|
||||
log_error("Can't use %s LV %s for pool metadata.",
|
||||
lv_type_name(metadata_lv), display_lvname(metadata_lv));
|
||||
log_error("Can't use thin or cache type LV %s for pool metadata.",
|
||||
display_lvname(metadata_lv));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2822,16 +2822,15 @@ static int _lvconvert_pool(struct cmd_context *cmd,
|
||||
|
||||
if (!lp->yes &&
|
||||
yes_no_prompt("Do you want to swap metadata of %s "
|
||||
"pool with %s volume %s? [y/n]: ",
|
||||
"pool with metadata volume %s? [y/n]: ",
|
||||
display_lvname(pool_lv),
|
||||
lv_type_name(metadata_lv),
|
||||
display_lvname(metadata_lv)) == 'n') {
|
||||
log_error("Conversion aborted.");
|
||||
return 0;
|
||||
}
|
||||
} else if (lv_is_thin_type(pool_lv)) {
|
||||
log_error("Can't use %s logical volume %s for thin pool data.",
|
||||
lv_type_name(pool_lv), display_lvname(pool_lv));
|
||||
log_error("Can't use thin type logical volume %s for thin pool data.",
|
||||
display_lvname(pool_lv));
|
||||
return 0;
|
||||
} else {
|
||||
log_warn("WARNING: Converting logical volume %s%s%s to pool's data%s.",
|
||||
@ -3047,8 +3046,8 @@ static int _lvconvert_cache(struct cmd_context *cmd,
|
||||
}
|
||||
|
||||
if (lv_is_pool(origin) || lv_is_cache_type(origin)) {
|
||||
log_error("Can't cache %s volume %s.",
|
||||
lv_type_name(origin), display_lvname(origin));
|
||||
log_error("Can't cache pool or cache type volume %s.",
|
||||
display_lvname(origin));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user