1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/format_text
David Teigland 79c4971210 label_scan: remove extra label scan and read for orphan PVs
When process_each_pv() calls vg_read() on the orphan VG, the
internal implementation was doing an unnecessary
lvmcache_label_scan() and two unnecessary label_read() calls
on each orphan.  Some of those unnecessary label scans/reads
would sometimes be skipped due to caching, but the code was
always doing at least one unnecessary read on each orphan.

The common format_text case was also unecessarily calling into
the format-specific pv_read() function which actually did nothing.

By analyzing each case in which vg_read() was being called on
the orphan VG, we can say that all of the label scans/reads
in vg_read_orphans are unnecessary:

1. reporting commands: the information saved in lvmcache by
the original label scan can be reported.  There is no advantage
to repeating the label scan on the orphans a second time before
reporting it.

2. pvcreate/vgcreate/vgextend: these all share a common
implementation in pvcreate_each_device().  That function
already rescans labels after acquiring the orphan VG lock,
which ensures that the command is using valid lvmcache
information.
2018-04-20 11:22:45 -05:00
..
archive.c scan: use bcache for label scan and vg read 2018-04-20 11:19:24 -05:00
archiver.c scan: use bcache for label scan and vg read 2018-04-20 11:19:24 -05:00
archiver.h vgcfgrestore: use lvmetad disabled state 2016-06-20 11:19:49 -05:00
export.c [io paths] Unpick agk's aio stuff 2018-04-20 11:03:58 -05:00
flags.c replicator: remove the code 2017-10-13 16:20:42 -05:00
format-text.c label_scan: remove extra label scan and read for orphan PVs 2018-04-20 11:22:45 -05:00
format-text.h cov: declaration matching 2016-12-11 23:24:19 +01:00
import_vsn1.c lvmetad: use new label_scan for update from pvscan 2018-04-20 11:22:43 -05:00
import-export.h scan: use bcache for label scan and vg read 2018-04-20 11:19:24 -05:00
import.c scan: use bcache for label scan and vg read 2018-04-20 11:19:24 -05:00
layout.h scan: use bcache for label scan and vg read 2018-04-20 11:19:24 -05:00
text_export.h coverity: fix possible resource leak of descendants_buffer in _print_historical_lv fn 2016-05-31 09:36:58 +02:00
text_import.h doc: change fsf address 2016-01-21 12:11:37 +01:00
text_label.c scan: use bcache for label scan and vg read 2018-04-20 11:19:24 -05:00