mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
vdo: add support for auto-unsafe writePolicy
This vdoWritePolicy policy missed matching support in lvm2.
This commit is contained in:
parent
337053c56a
commit
79427151dc
@ -1,5 +1,6 @@
|
||||
Version 2.03.14 -
|
||||
==================================
|
||||
Add support for VDO async-unsage write policy.
|
||||
Improve lvm_import_vdo script.
|
||||
Support VDO LV with lvcreate -ky.
|
||||
Fix lvconvert for VDO LV bigger then 2T.
|
||||
|
@ -713,6 +713,8 @@ allocation {
|
||||
# This policy is not supported if the underlying storage is not also synchronous.
|
||||
# async - Writes are acknowledged after data has been cached for writing to stable storage.
|
||||
# Data which has not been flushed is not guaranteed to persist in this mode.
|
||||
# async-unsafe - Writes are handled like 'async' but there is no guarantee of the atomicity async provides.
|
||||
# This mode should only be used for better performance when atomicity is not required.
|
||||
# This configuration option has an automatic default value.
|
||||
# vdo_write_policy = "auto"
|
||||
|
||||
|
@ -2885,7 +2885,8 @@ static int _vdo_emit_segment_line(struct dm_task *dmt,
|
||||
seg->vdo_params.block_map_era_length,
|
||||
seg->vdo_params.use_metadata_hints ? "on" : "off" ,
|
||||
(seg->vdo_params.write_policy == DM_VDO_WRITE_POLICY_SYNC) ? "sync" :
|
||||
(seg->vdo_params.write_policy == DM_VDO_WRITE_POLICY_ASYNC) ? "async" : "auto", // policy
|
||||
(seg->vdo_params.write_policy == DM_VDO_WRITE_POLICY_ASYNC) ? "async" :
|
||||
(seg->vdo_params.write_policy == DM_VDO_WRITE_POLICY_ASYNC_UNSAFE) ? "async-unsafe" : "auto", // policy
|
||||
seg->vdo_name,
|
||||
seg->vdo_params.max_discard,
|
||||
seg->vdo_params.ack_threads,
|
||||
|
@ -69,7 +69,8 @@ bool dm_vdo_status_parse(struct dm_pool *mem, const char *input,
|
||||
enum dm_vdo_write_policy {
|
||||
DM_VDO_WRITE_POLICY_AUTO = 0,
|
||||
DM_VDO_WRITE_POLICY_SYNC,
|
||||
DM_VDO_WRITE_POLICY_ASYNC
|
||||
DM_VDO_WRITE_POLICY_ASYNC,
|
||||
DM_VDO_WRITE_POLICY_ASYNC_UNSAFE
|
||||
};
|
||||
|
||||
// FIXME: review whether we should use the createParams from the userlib
|
||||
|
@ -100,6 +100,7 @@ bool dm_vdo_validate_target_params(const struct dm_vdo_target_params *vtp,
|
||||
switch (vtp->write_policy) {
|
||||
case DM_VDO_WRITE_POLICY_SYNC:
|
||||
case DM_VDO_WRITE_POLICY_ASYNC:
|
||||
case DM_VDO_WRITE_POLICY_ASYNC_UNSAFE:
|
||||
case DM_VDO_WRITE_POLICY_AUTO:
|
||||
break;
|
||||
default:
|
||||
|
@ -796,7 +796,9 @@ cfg(allocation_vdo_write_policy_CFG, "vdo_write_policy", allocation_CFG_SECTION,
|
||||
"sync - Writes are acknowledged only after data is stably written.\n"
|
||||
" This policy is not supported if the underlying storage is not also synchronous.\n"
|
||||
"async - Writes are acknowledged after data has been cached for writing to stable storage.\n"
|
||||
" Data which has not been flushed is not guaranteed to persist in this mode.\n")
|
||||
" Data which has not been flushed is not guaranteed to persist in this mode.\n"
|
||||
"async-unsafe - Writes are handled like 'async' but there is no guarantee of the atomicity async provides.\n"
|
||||
" This mode should only be used for better performance when atomicity is not required.\n")
|
||||
|
||||
cfg(allocation_vdo_max_discard_CFG, "vdo_max_discard", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_VDO_MAX_DISCARD, VDO_1ST_VSN, NULL, 0, NULL,
|
||||
"Specified the maximum size of discard bio accepted, in 4096 byte blocks.\n"
|
||||
|
@ -81,6 +81,8 @@ const char *get_vdo_write_policy_name(enum dm_vdo_write_policy policy)
|
||||
return "sync";
|
||||
case DM_VDO_WRITE_POLICY_ASYNC:
|
||||
return "async";
|
||||
case DM_VDO_WRITE_POLICY_ASYNC_UNSAFE:
|
||||
return "async-unsafe";
|
||||
default:
|
||||
log_debug(INTERNAL_ERROR "Unrecognized VDO write policy: %u.", policy);
|
||||
/* Fall through */
|
||||
@ -441,6 +443,8 @@ int set_vdo_write_policy(enum dm_vdo_write_policy *vwp, const char *policy)
|
||||
*vwp = DM_VDO_WRITE_POLICY_SYNC;
|
||||
else if (strcasecmp(policy, "async") == 0)
|
||||
*vwp = DM_VDO_WRITE_POLICY_ASYNC;
|
||||
else if (strcasecmp(policy, "async-unsafe") == 0)
|
||||
*vwp = DM_VDO_WRITE_POLICY_ASYNC_UNSAFE;
|
||||
else if (strcasecmp(policy, "auto") == 0)
|
||||
*vwp = DM_VDO_WRITE_POLICY_AUTO;
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user