mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Fix --[vg]metadatacopies arg processing
This commit is contained in:
parent
12eadbabdd
commit
77d308ef77
@ -23,8 +23,8 @@ arg(physicalvolumesize_ARG, '\0', "setphysicalvolumesize", size_mb_arg, 0)
|
|||||||
arg(ignorelockingfailure_ARG, '\0', "ignorelockingfailure", NULL, 0)
|
arg(ignorelockingfailure_ARG, '\0', "ignorelockingfailure", NULL, 0)
|
||||||
arg(nolocking_ARG, '\0', "nolocking", NULL, 0)
|
arg(nolocking_ARG, '\0', "nolocking", NULL, 0)
|
||||||
arg(pvmetadatacopies_ARG, '\0', "pvmetadatacopies", int_arg, 0)
|
arg(pvmetadatacopies_ARG, '\0', "pvmetadatacopies", int_arg, 0)
|
||||||
arg(vgmetadatacopies_ARG, '\0', "vgmetadatacopies", vgmetadatacopies_arg, 0)
|
arg(vgmetadatacopies_ARG, '\0', "vgmetadatacopies", metadatacopies_arg, 0)
|
||||||
arg(metadatacopies_ARG, '\0', "metadatacopies", int_arg, 0)
|
arg(metadatacopies_ARG, '\0', "metadatacopies", metadatacopies_arg, 0)
|
||||||
arg(metadatasize_ARG, '\0', "metadatasize", size_mb_arg, 0)
|
arg(metadatasize_ARG, '\0', "metadatasize", size_mb_arg, 0)
|
||||||
arg(metadataignore_ARG, '\0', "metadataignore", yes_no_arg, 0)
|
arg(metadataignore_ARG, '\0', "metadataignore", yes_no_arg, 0)
|
||||||
arg(restorefile_ARG, '\0', "restorefile", string_arg, 0)
|
arg(restorefile_ARG, '\0', "restorefile", string_arg, 0)
|
||||||
|
@ -476,9 +476,10 @@ int readahead_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a)
|
|||||||
/*
|
/*
|
||||||
* Non-zero, positive integer, "all", or "unmanaged"
|
* Non-zero, positive integer, "all", or "unmanaged"
|
||||||
*/
|
*/
|
||||||
int vgmetadatacopies_arg(struct cmd_context *cmd __attribute((unused)),
|
int metadatacopies_arg(struct cmd_context *cmd __attribute((unused)),
|
||||||
struct arg *a)
|
struct arg *a)
|
||||||
{
|
{
|
||||||
|
if (!strncmp(cmd->command->name, "vg", 2)) {
|
||||||
if (!strcasecmp(a->value, "all")) {
|
if (!strcasecmp(a->value, "all")) {
|
||||||
a->ui_value = VGMETADATACOPIES_ALL;
|
a->ui_value = VGMETADATACOPIES_ALL;
|
||||||
return 1;
|
return 1;
|
||||||
@ -488,17 +489,9 @@ int vgmetadatacopies_arg(struct cmd_context *cmd __attribute((unused)),
|
|||||||
a->ui_value = VGMETADATACOPIES_UNMANAGED;
|
a->ui_value = VGMETADATACOPIES_UNMANAGED;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_size_arg(cmd, a, 1))
|
return int_arg(cmd, a);
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (a->sign == SIGN_MINUS)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!a->ui_value)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __alloc(int size)
|
static void __alloc(int size)
|
||||||
|
@ -152,8 +152,7 @@ int units_arg(struct cmd_context *cmd, struct arg *a);
|
|||||||
int segtype_arg(struct cmd_context *cmd, struct arg *a);
|
int segtype_arg(struct cmd_context *cmd, struct arg *a);
|
||||||
int alloc_arg(struct cmd_context *cmd, struct arg *a);
|
int alloc_arg(struct cmd_context *cmd, struct arg *a);
|
||||||
int readahead_arg(struct cmd_context *cmd, struct arg *a);
|
int readahead_arg(struct cmd_context *cmd, struct arg *a);
|
||||||
int vgmetadatacopies_arg(struct cmd_context *cmd __attribute((unused)),
|
int metadatacopies_arg(struct cmd_context *cmd __attribute((unused)), struct arg *a);
|
||||||
struct arg *a);
|
|
||||||
|
|
||||||
/* we use the enums to access the switches */
|
/* we use the enums to access the switches */
|
||||||
unsigned arg_count(const struct cmd_context *cmd, int a);
|
unsigned arg_count(const struct cmd_context *cmd, int a);
|
||||||
|
Loading…
Reference in New Issue
Block a user