mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
cache: rename variable in _cache_display
so it is not specific to lv/seg type
This commit is contained in:
parent
85b4b2f924
commit
7541e002b2
@ -47,23 +47,30 @@ static int _cache_out_line(const char *line, void *_f)
|
|||||||
static void _cache_display(const struct lv_segment *seg)
|
static void _cache_display(const struct lv_segment *seg)
|
||||||
{
|
{
|
||||||
const struct dm_config_node *n;
|
const struct dm_config_node *n;
|
||||||
const struct lv_segment *pool_seg =
|
const struct lv_segment *setting_seg = NULL;
|
||||||
seg_is_cache_pool(seg) ? seg : first_seg(seg->pool_lv);
|
|
||||||
|
if (seg_is_cache_pool(seg))
|
||||||
|
setting_seg = seg;
|
||||||
|
|
||||||
|
else if (seg_is_cache(seg))
|
||||||
|
setting_seg = first_seg(seg->pool_lv);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
log_print(" Chunk size\t\t%s",
|
log_print(" Chunk size\t\t%s",
|
||||||
display_size(seg->lv->vg->cmd, pool_seg->chunk_size));
|
display_size(seg->lv->vg->cmd, setting_seg->chunk_size));
|
||||||
|
|
||||||
if (pool_seg->cache_metadata_format != CACHE_METADATA_FORMAT_UNSELECTED)
|
if (setting_seg->cache_metadata_format != CACHE_METADATA_FORMAT_UNSELECTED)
|
||||||
log_print(" Metadata format\t%u", pool_seg->cache_metadata_format);
|
log_print(" Metadata format\t%u", setting_seg->cache_metadata_format);
|
||||||
|
|
||||||
if (pool_seg->cache_mode != CACHE_MODE_UNSELECTED)
|
if (setting_seg->cache_mode != CACHE_MODE_UNSELECTED)
|
||||||
log_print(" Mode\t\t%s", get_cache_mode_name(pool_seg));
|
log_print(" Mode\t\t%s", get_cache_mode_name(setting_seg));
|
||||||
|
|
||||||
if (pool_seg->policy_name)
|
if (setting_seg->policy_name)
|
||||||
log_print(" Policy\t\t%s", pool_seg->policy_name);
|
log_print(" Policy\t\t%s", setting_seg->policy_name);
|
||||||
|
|
||||||
if (pool_seg->policy_settings &&
|
if (setting_seg->policy_settings &&
|
||||||
(n = pool_seg->policy_settings->child))
|
(n = setting_seg->policy_settings->child))
|
||||||
dm_config_write_node(n, _cache_out_line, NULL);
|
dm_config_write_node(n, _cache_out_line, NULL);
|
||||||
|
|
||||||
log_print(" ");
|
log_print(" ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user