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

vdo: introduce get_vdo_write_policy_name

This commit is contained in:
Zdenek Kabelac 2019-10-04 14:59:00 +02:00
parent c756f76802
commit cf8aee096f
2 changed files with 16 additions and 0 deletions

View File

@ -1301,6 +1301,7 @@ struct lv_status_vdo {
const char *get_vdo_compression_state_name(enum dm_vdo_compression_state state); const char *get_vdo_compression_state_name(enum dm_vdo_compression_state state);
const char *get_vdo_index_state_name(enum dm_vdo_index_state state); const char *get_vdo_index_state_name(enum dm_vdo_index_state state);
const char *get_vdo_operating_mode_name(enum dm_vdo_operating_mode mode); const char *get_vdo_operating_mode_name(enum dm_vdo_operating_mode mode);
const char *get_vdo_write_policy_name(enum dm_vdo_write_policy policy);
uint64_t get_vdo_pool_virtual_size(const struct lv_segment *vdo_pool_seg); uint64_t get_vdo_pool_virtual_size(const struct lv_segment *vdo_pool_seg);
int update_vdo_pool_virtual_size(struct lv_segment *vdo_pool_seg); int update_vdo_pool_virtual_size(struct lv_segment *vdo_pool_seg);
int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_pool_lv, int parse_vdo_pool_status(struct dm_pool *mem, const struct logical_volume *vdo_pool_lv,

View File

@ -74,6 +74,21 @@ const char *get_vdo_operating_mode_name(enum dm_vdo_operating_mode mode)
} }
} }
const char *get_vdo_write_policy_name(enum dm_vdo_write_policy policy)
{
switch (policy) {
case DM_VDO_WRITE_POLICY_SYNC:
return "sync";
case DM_VDO_WRITE_POLICY_ASYNC:
return "async";
default:
log_debug(INTERNAL_ERROR "Unrecognized VDO write policy: %u.", policy);
/* Fall through */
case DM_VDO_WRITE_POLICY_AUTO:
return "auto";
}
}
/* /*
* Size of VDO virtual LV is adding header_size in front and back of device * Size of VDO virtual LV is adding header_size in front and back of device
* to avoid colission with blkid checks. * to avoid colission with blkid checks.