summaryrefslogtreecommitdiff
path: root/lib/cache
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 /lib/cache
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 'lib/cache')
-rw-r--r--lib/cache/lvmcache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index a798f5ab8..e15b6ce85 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -799,8 +799,8 @@ next:
same_id2 = !strcmp(idname2, device_id);
}
- has_lv1 = (dev1->flags & DEV_USED_FOR_LV) ? 1 : 0;
- has_lv2 = (dev2->flags & DEV_USED_FOR_LV) ? 1 : 0;
+ has_lv1 = dev_is_used_by_active_lv(cmd, dev1, NULL, NULL, NULL, NULL);
+ has_lv2 = dev_is_used_by_active_lv(cmd, dev2, NULL, NULL, NULL, NULL);
in_subsys1 = dev_subsystem_part_major(dt, dev1);
in_subsys2 = dev_subsystem_part_major(dt, dev2);