]> sourceware.org Git - lvm2.git/commit
Add find_vgname_from_{pvname|pvid} functions.
authorDave Wysochanski <dwysocha@redhat.com>
Wed, 19 May 2010 11:52:37 +0000 (11:52 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Wed, 19 May 2010 11:52:37 +0000 (11:52 +0000)
commitada4c61860de80e45f101b8ad7f9bab542c172d5
tree9b769407439cd979093c4127646a083d2e0e30f7
parent9bcaa9475646707b8a6e269ae4ba14b26373e5aa
Add find_vgname_from_{pvname|pvid} functions.

Some commands start with a pvname, but we'd like to force users to
start with a vg handle to obtain a pv handle.  Our best option seems
to be providing a way to look up the vgname from the pvname, and then
require them to use vg_read/vg_open.

In addition to the pvname lookup function, this patch also provides a
lookup by pvid.  The lookup by pvid can be used in conjunction with
lvmcache_get_pvids to process all pvs in the system.

The pvid find function first calls lvmcache_vgname_from_pvid, which may
cause the label to be read if it is not in the cache.  If the vgname is
returned is an orphan, we then check to see if there are metadata areas,
and if not, we scan every PV on the system by calling scan_vgs_for_pvs().
In most cases we should not need to do this, and by using the info->mdas
count, we avoid calling pv_read() as prior code did.  So this patch is a
bit cleaner and should allow us to refactor more of the pv code.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
lib/metadata/metadata-exported.h
lib/metadata/metadata.c
This page took 0.029636 seconds and 5 git commands to generate.