diff options
author | David Teigland <teigland@redhat.com> | 2021-07-01 17:25:43 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2021-07-06 10:18:07 -0500 |
commit | d5a06f9a7df5a43b2e2311db62ff8d3011217d74 (patch) | |
tree | 3e3c964f9187c3659ce16733ea325b36dd584767 /lib/commands | |
parent | b876dbfc245b8fe0a4c433b39d214652455c3f9e (diff) | |
download | lvm2-d5a06f9a7df5a43b2e2311db62ff8d3011217d74.tar.gz |
pvscan: skip indexing devices used by LVs
dev_cache_index_devs() is taking a large amount of time
when there are many PVs. The index keeps track of
devices that are currently in use by active LVs. This
info is used to print warnings for users in some limited
cases.
The checks/warnings that are enabled by the index are not
needed by pvscan --cache, so disable it in this case.
This may be expanded to other cases in future commits.
dev_cache_index_devs should also be improved in another
commit to avoid the extreme delays with many devices.
Diffstat (limited to 'lib/commands')
-rw-r--r-- | lib/commands/toolcontext.c | 1 | ||||
-rw-r--r-- | lib/commands/toolcontext.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index e2be89d0f..b295a20ef 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1608,6 +1608,7 @@ struct cmd_context *create_toolcontext(unsigned is_clvmd, cmd->handles_missing_pvs = 0; cmd->handles_unknown_segments = 0; cmd->hosttags = 0; + cmd->check_devs_used = 1; dm_list_init(&cmd->arg_value_groups); dm_list_init(&cmd->formats); dm_list_init(&cmd->segtypes); diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h index a47b7d760..34808ce46 100644 --- a/lib/commands/toolcontext.h +++ b/lib/commands/toolcontext.h @@ -192,6 +192,7 @@ struct cmd_context { unsigned filter_nodata_only:1; /* only use filters that do not require data from the dev */ unsigned run_by_dmeventd:1; /* command is being run by dmeventd */ unsigned sysinit:1; /* --sysinit is used */ + unsigned check_devs_used:1; /* check devs used by LVs */ /* * Devices and filtering. |