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

remove unnecessary REQUIRES_FULL_LABEL_SCAN

we always scan all devices
This commit is contained in:
David Teigland 2018-04-06 13:18:03 -05:00
parent 45e5e702c1
commit 89c65d4f71
5 changed files with 5 additions and 19 deletions

View File

@ -134,13 +134,12 @@ static inline int configtype_arg(struct cmd_context *cmd __attribute__((unused))
#define ALLOW_UUID_AS_NAME 0x00000010
#define LOCKD_VG_SH 0x00000020
#define NO_METADATA_PROCESSING 0x00000040
#define REQUIRES_FULL_LABEL_SCAN 0x00000080
#define IGNORE_PERSISTENT_FILTER 0x00000080
#define MUST_USE_ALL_ARGS 0x00000100
#define NO_LVMETAD_AUTOSCAN 0x00000200
#define ENABLE_DUPLICATE_DEVS 0x00000400
#define DISALLOW_TAG_ARGS 0x00000800
#define GET_VGNAME_FROM_OPTIONS 0x00001000
#define IGNORE_PERSISTENT_FILTER 0x00002000
/* create foo_CMD enums for command def ID's in command-lines.in */

View File

@ -225,7 +225,7 @@ xx(vgremove,
xx(vgrename,
"Rename a volume group",
ALLOW_UUID_AS_NAME | REQUIRES_FULL_LABEL_SCAN)
ALLOW_UUID_AS_NAME)
xx(vgs,
"Display information about volume groups",

View File

@ -2727,11 +2727,6 @@ static int _cmd_no_lvmetad_autoscan(struct cmd_context *cmd)
return cmd->cname->flags & NO_LVMETAD_AUTOSCAN;
}
static int _cmd_requires_full_label_scan(struct cmd_context *cmd)
{
return cmd->cname->flags & REQUIRES_FULL_LABEL_SCAN;
}
static int _cmd_ignores_persistent_filter(struct cmd_context *cmd)
{
return cmd->cname->flags & IGNORE_PERSISTENT_FILTER;
@ -2865,7 +2860,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
* Similarly ignore the persistent cache if the command is going to discard it regardless.
*/
if (!cmd->initialized.filters && !_cmd_no_meta_proc(cmd) &&
!init_filters(cmd, !(refresh_done || _cmd_requires_full_label_scan(cmd) || _cmd_ignores_persistent_filter(cmd))))
!init_filters(cmd, !(refresh_done || _cmd_ignores_persistent_filter(cmd))))
return_ECMD_FAILED;
if (arg_is_set(cmd, readonly_ARG))

View File

@ -124,8 +124,8 @@ struct arg_value_group_list {
#define LOCKD_VG_SH 0x00000020
/* Command does not process any metadata. */
#define NO_METADATA_PROCESSING 0x00000040
/* Command wants to scan for new devices and force labels to be read from them all. */
#define REQUIRES_FULL_LABEL_SCAN 0x00000080
/* Command must not load the contents saved by the persistent filter */
#define IGNORE_PERSISTENT_FILTER 0x00000080
/* Command must use all specified arg names and fail if all cannot be used. */
#define MUST_USE_ALL_ARGS 0x00000100
/* Command wants to control the device scan for lvmetad itself. */
@ -136,9 +136,6 @@ struct arg_value_group_list {
#define DISALLOW_TAG_ARGS 0x00000800
/* Command may need to find VG name in an option value. */
#define GET_VGNAME_FROM_OPTIONS 0x00001000
/* Command must not load the contents saved by the persistent filter */
#define IGNORE_PERSISTENT_FILTER 0x00002000
void usage(const char *name);
/* the argument verify/normalise functions */

View File

@ -59,11 +59,6 @@ static int _vgrename_single(struct cmd_context *cmd, const char *vg_name,
/*
* Check if a VG already exists with the new VG name.
*
* When not using lvmetad, it's essential that a full scan has
* been done to ensure we see all existing VG names, so we
* do not use an existing name. This has been done by
* process_each_vg REQUIRES_FULL_LABEL_SCAN.
*
* (FIXME: We could look for the new name in the list of all
* VGs that process_each_vg created, but we don't have access
* to that list here, so we have to look in lvmcache.