OO_LVCREATE_CACHE accepts --cachemetadataformat.
Support new option --cachemetadataformat auto|1|2 for caching.
Word 'auto' can be also be given as '0'.
"#lvscan\n"
"Scan the devices used by an LV and send the metadata to lvmetad.\n")
+arg(cachemetadataformat_ARG, '\0', "cachemetadataformat", cachemetadataformat_VAL, 0, 0,
+ "Specifies the cache metadata format used by cache target.\n")
+
arg(cachemode_ARG, '\0', "cachemode", cachemode_VAL, 0, 0,
"Specifies when writes to a cache LV should be considered complete.\n"
"\\fBwriteback\\fP considers a write complete as soon as it is\n"
--poolmetadataspare Bool, --readahead Readahead, --chunksize SizeKB,
--zero Bool, --metadataprofile String
-OO_LVCONVERT_CACHE: --cachemode CacheMode, --cachepolicy String,
+OO_LVCONVERT_CACHE: --cachemetadataformat CacheMetadataFormat,
+--cachemode CacheMode, --cachepolicy String,
--cachesettings String, --zero Bool
OO_LVCONVERT: --alloc Alloc, --background, --force, --noudevsync
--zero Bool
OO_LVCREATE_CACHE: --cachemode CacheMode, --cachepolicy String, --cachesettings String,
---chunksize SizeKB
+--chunksize SizeKB, --cachemetadataformat CacheMetadataFormat
OO_LVCREATE_POOL: --poolmetadatasize SizeMB, --poolmetadataspare Bool, --chunksize SizeKB
/* needed to include args.h */
static inline int yes_no_arg(struct cmd_context *cmd, struct arg_values *av) { return 0; }
static inline int activation_arg(struct cmd_context *cmd, struct arg_values *av) { return 0; }
+static inline int cachemetadataformat_arg(struct cmd_context *cmd, struct arg_values *av) { return 0; }
static inline int cachemode_arg(struct cmd_context *cmd, struct arg_values *av) { return 0; }
static inline int discards_arg(struct cmd_context *cmd, struct arg_values *av) { return 0; }
static inline int mirrorlog_arg(struct cmd_context *cmd, struct arg_values *av) { return 0; }
return 1;
}
+int cachemetadataformat_arg(struct cmd_context *cmd, struct arg_values *av)
+{
+ if (!strcmp(av->value, "auto")) {
+ av->i_value = CACHE_METADATA_FORMAT_UNSELECTED;
+ av->ui_value = CACHE_METADATA_FORMAT_UNSELECTED;
+ } else if (!int_arg(cmd, av))
+ return_0;
+
+ switch (av->i_value) {
+ case CACHE_METADATA_FORMAT_UNSELECTED:
+ case CACHE_METADATA_FORMAT_1:
+ case CACHE_METADATA_FORMAT_2:
+ return 1;
+ }
+
+ log_error("Selected cache metadata format %d is not supported.", av->i_value);
+ return 0;
+}
+
int discards_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_values *av)
{
thin_discards_t discards;
/* the argument verify/normalise functions */
int yes_no_arg(struct cmd_context *cmd, struct arg_values *av);
int activation_arg(struct cmd_context *cmd, struct arg_values *av);
+int cachemetadataformat_arg(struct cmd_context *cmd, struct arg_values *av);
int cachemode_arg(struct cmd_context *cmd, struct arg_values *av);
int discards_arg(struct cmd_context *cmd, struct arg_values *av);
int mirrorlog_arg(struct cmd_context *cmd, struct arg_values *av);
val(select_VAL, NULL, "Select", NULL) /* used only for command defs */
val(activationmode_VAL, string_arg, "ActivationMode", "partial|degraded|complete")
val(activation_VAL, activation_arg, "Active", "y|n|ay")
+val(cachemetadataformat_VAL, cachemetadataformat_arg, "CacheMetadataFormat", "auto|1|2")
val(cachemode_VAL, cachemode_arg, "CacheMode", "writethrough|writeback|passthrough")
val(discards_VAL, discards_arg, "Discards", "passdown|nopassdown|ignore")
val(mirrorlog_VAL, mirrorlog_arg, "MirrorLog", "core|disk")