]> sourceware.org Git - lvm2.git/commit
pvscan: use process_each_pv
authorDavid Teigland <teigland@redhat.com>
Mon, 19 Oct 2015 18:58:43 +0000 (13:58 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 19 Oct 2015 21:15:51 +0000 (16:15 -0500)
commit83d475626a4d9ecaa2084f349cb2cee4f0f3a719
tree31bf9b19ec767e998735a2b2871868fa6f79c10f
parent1ea7e2634d67a7628508a677668a00f748aee0b0
pvscan: use process_each_pv

The old code made two loops through the PVs: in the first
loop it found the max PV and VG name lengths, and in the
second loop it printed each PV using the name lengths as
field widths for aligning columns.

The new code uses process_each_pv() which makes one loop
through the PVs.  In the *first* call to pvscan_single(),
the max name lengths are found by looping through the
lvmcache entries which have been populated by the generic
process_each code prior to calling any _single functions.
Subsequent calls to pvscan_single() reuse the max lengths
that were found by the first call.
lib/cache/lvmcache.c
lib/cache/lvmcache.h
tools/pvscan.c
This page took 0.0373 seconds and 5 git commands to generate.