1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lv_ondisk: option search for lv without vg_ondisk

When vg_ondisk is NULL we do not need to search
through the whole VG to find out the same LV.

NOTE: as of now - VG locking is not enabled as some code parts
are breaking memory locking rules (lvm2app).

Once we enforce VG locking for read-only commands the effect
will be much better for larger VGs.
This commit is contained in:
Zdenek Kabelac 2014-09-21 23:10:04 +02:00
parent 0f2adcc9ef
commit 9776979b02
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.112 -
=====================================
Improve search of LV in lv_ondisk().
Do not scan sysfs in lv_check_not_in_use() when device is closed.
Backup final metadata after resync of mirror/raid.
Unify handling of --persistent option for lvcreate and lvchange.

View File

@ -4813,10 +4813,10 @@ struct logical_volume *lv_ondisk(struct logical_volume *lv)
if (!lv)
return NULL;
vg = lv->vg;
if (!lv->vg->vg_ondisk)
return lv;
if (vg->vg_ondisk)
vg = vg->vg_ondisk;
vg = lv->vg->vg_ondisk;
dm_list_iterate_items(lvl, &vg->lvs)
if (!strncmp(lvl->lv->lvid.s, lv->lvid.s, sizeof(lv->lvid)))