1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: enum mapping cache format

Cleanly map cache metadata format enumeration.
This commit is contained in:
Zdenek Kabelac 2024-05-07 17:19:55 +02:00
parent f0d3d0482e
commit 5f1c799e6a

View File

@ -913,8 +913,13 @@ int cache_set_metadata_format(struct lv_segment *seg, cache_metadata_format_t fo
return 1; /* Format already selected in cache pool */
/* Check configurations and profiles */
format = find_config_tree_int(seg->lv->vg->cmd, allocation_cache_metadata_format_CFG,
profile);
switch (find_config_tree_int(seg->lv->vg->cmd,
allocation_cache_metadata_format_CFG,
profile)) {
case 1: format = CACHE_METADATA_FORMAT_1; break;
case 2: format = CACHE_METADATA_FORMAT_2; break;
default: format = CACHE_METADATA_FORMAT_UNSELECTED; break;
}
}
/* See what is a 'best' available cache metadata format