summaryrefslogtreecommitdiff
path: root/lib/metadata/vdo_manip.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2019-10-04 14:59:00 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2019-10-04 17:31:55 +0200
commitcf8aee096f2064fb8d8421f73807ad98746bc7c6 (patch)
tree753ce8b9ed382f7bbe99effd0ba95a4c3403be45 /lib/metadata/vdo_manip.c
parentc756f7680202f0a59dea917527e95f68c7a9af4b (diff)
downloadlvm2-cf8aee096f2064fb8d8421f73807ad98746bc7c6.tar.gz
vdo: introduce get_vdo_write_policy_name
Diffstat (limited to 'lib/metadata/vdo_manip.c')
-rw-r--r--lib/metadata/vdo_manip.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index 7ed3ef97b..26694cc9a 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -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
* to avoid colission with blkid checks.