[lvm-devel] [PATCH 2/3] Add find_vgname_from_pvname() function using lvmcache functions.
Dave Wysochanski
dwysocha at redhat.com
Wed Mar 17 16:50:48 UTC 2010
On Wed, 2010-03-17 at 11:51 -0400, Dave Wysochanski wrote:
> +char *find_vgname_from_pvname(struct cmd_context *cmd, const char
> *pvname)
> +{
> + char *vgname;
> + struct lvmcache_info *info;
> +
> + /*
> + * Initially, all we have is a pv name - we don't know the VG
> name.
> + * Try to look the name up in lvmcache.
> + */
> + lvmcache_label_scan(cmd, 0);
> + vgname = lvmcache_vgname_from_pvname(cmd, pvname);
> +
Actually the lvmcache_label_scan() should not be necessary here.
We read the label for the device later and the expensive scans if
necessary (orphan and no mdas).
More information about the lvm-devel
mailing list