summaryrefslogtreecommitdiff
path: root/tools/lvmcmdline.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-07-07 16:59:56 -0500
committerDavid Teigland <teigland@redhat.com>2021-07-09 13:59:31 -0500
commit66daedc6d27d07e4bcd43ee0286e21a69fdc33d9 (patch)
treef4b54f96d874709e478ebf964921059aba70c7eb /tools/lvmcmdline.c
parent70c32d1e74b92f6055bcb688ed0e3bc8630f5489 (diff)
downloadlvm2-66daedc6d27d07e4bcd43ee0286e21a69fdc33d9.tar.gz
skip indexing devices used by LVs in more commands
expands commit d5a06f9a7df5a43b2e2311db62ff8d3011217d74 "pvscan: skip indexing devices used by LVs" The dev cache index is expensive and slow, so limit it to commands that are used to observe the state of lvm. The index is only used to print warnings about incorrect device use by active LVs, e.g. if an LV is using a multipath component device instead of the multipath device. Commands that continue to use the index and print the warnings: fullreport, lvmdiskscan, vgs, lvs, pvs, vgdisplay, lvdisplay, pvdisplay, vgscan, lvscan, pvscan (excluding --cache) A couple other commands were borrowing the DEV_USED_FOR_LV flag to just check if a device was actively in use by LVs. These are converted to the new dev_is_used_by_active_lv().
Diffstat (limited to 'tools/lvmcmdline.c')
-rw-r--r--tools/lvmcmdline.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index d97ff5720..490c9c73d 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2473,6 +2473,8 @@ static int _get_current_settings(struct cmd_context *cmd)
cmd->allow_mixed_block_sizes = find_config_tree_bool(cmd, devices_allow_mixed_block_sizes_CFG, NULL);
+ cmd->check_devs_used = (cmd->cname->flags & CHECK_DEVS_USED) ? 1 : 0;
+
/*
* enable_hints is set to 1 if any commands are using hints.
* use_hints is set to 1 if this command should use the hints.