mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
748f29b42a
Move the location of scans to make it clearer and avoid unnecessary repeated scanning. There should be one scan at the start of a command which is then used through the rest of command processing. Previously, the initial label scan was called as a side effect from various utility functions. This would lead to it being called unnecessarily. It is an expensive operation, and should only be called when necessary. Also, this is a primary step in the function of the command, and as such it should be called prominently at the top level of command processing, not as a hidden side effect of a utility function. lvm knows exactly where and when the label scan needs to be done. Because of this, move the label scan calls from the internal functions to the top level of processing. Other specific instances of lvmcache_label_scan() are still called unnecessarily or unclearly by specific commands that do not use the common process_each functions. These will be improved in future commits. During the processing phase, rescanning labels for devices in a VG needs to be done after the VG lock is acquired in case things have changed since the initial label scan. This was being done by way of rescanning devices that had the INVALID flag set in lvmcache. This usually approximated the right set of devices, but it was not exact, and obfuscated the real requirement. Correct this by using a new function that rescans the devices in the VG: lvmcache_label_rescan_vg(). Apart from being inexact, the rescanning was extremely well hidden. _vg_read() would call ->create_instance(), _text_create_text_instance(), _create_vg_text_instance() which would call lvmcache_label_scan() which would call _scan_invalid() which repeats the label scan on devices flagged INVALID. lvmcache_label_rescan_vg() is now called prominently by _vg_read() directly. |
||
---|---|---|
.. | ||
.exported_symbols | ||
.gitignore | ||
args.h | ||
cmdnames.h | ||
command-lines.in | ||
command.c | ||
command.h | ||
commands.h | ||
dmsetup.c | ||
dumpconfig.c | ||
errors.h | ||
formats.c | ||
license.inc | ||
lv_props.h | ||
lv_types.h | ||
lvchange.c | ||
lvconvert_poll.c | ||
lvconvert_poll.h | ||
lvconvert.c | ||
lvcreate.c | ||
lvdisplay.c | ||
lvextend.c | ||
lvm2cmd-static.c | ||
lvm2cmd.c | ||
lvm2cmd.h | ||
lvm2cmdline.h | ||
lvm-static.c | ||
lvm.c | ||
lvmcmdlib.c | ||
lvmcmdline.c | ||
lvmdiskscan.c | ||
lvpoll.c | ||
lvreduce.c | ||
lvremove.c | ||
lvrename.c | ||
lvresize.c | ||
lvscan.c | ||
Makefile.in | ||
polldaemon.c | ||
pvchange.c | ||
pvck.c | ||
pvcreate.c | ||
pvdisplay.c | ||
pvmove_poll.c | ||
pvmove_poll.h | ||
pvmove.c | ||
pvremove.c | ||
pvresize.c | ||
pvscan.c | ||
reporter.c | ||
segtypes.c | ||
stub.h | ||
tags.c | ||
tool.h | ||
toollib.c | ||
toollib.h | ||
tools.h | ||
vals.h | ||
vgcfgbackup.c | ||
vgcfgrestore.c | ||
vgchange.c | ||
vgck.c | ||
vgconvert.c | ||
vgcreate.c | ||
vgdisplay.c | ||
vgexport.c | ||
vgextend.c | ||
vgimport.c | ||
vgimportclone.c | ||
vgmerge.c | ||
vgmknodes.c | ||
vgreduce.c | ||
vgremove.c | ||
vgrename.c | ||
vgscan.c | ||
vgsplit.c |