1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-11-01 00:23:49 +03:00

Add is_orphan_vg() and change all hardcoded checks to use it.

This commit is contained in:
Bryn M. Reeves
2007-11-02 13:06:42 +00:00
parent e1d586d70e
commit 8b98c12815
11 changed files with 36 additions and 21 deletions

View File

@@ -1438,7 +1438,8 @@ static int _text_pv_read(const struct format_type *fmt, const char *pv_name,
info = (struct lvmcache_info *) label->info;
/* Have we already cached vgname? */
if (info->vginfo && info->vginfo->vgname && *info->vginfo->vgname &&
if (info->vginfo && info->vginfo->vgname &&
!is_orphan_vg(info->vginfo->vgname) &&
get_pv_from_vg_by_id(info->fmt, info->vginfo->vgname,
info->vginfo->vgid, info->dev->pvid, pv)) {
return 1;
@@ -1449,7 +1450,7 @@ static int _text_pv_read(const struct format_type *fmt, const char *pv_name,
lvmcache_label_scan(fmt->cmd, 2);
if (info->vginfo && info->vginfo->vgname &&
*info->vginfo->vgname &&
!is_orphan_vg(info->vginfo->vgname) &&
get_pv_from_vg_by_id(info->fmt, info->vginfo->vgname,
info->vginfo->vgid,
info->dev->pvid, pv)) {