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

metadata: fallback search without radix_tree

If we use some dummy vg struct, allow fallback
plain dm_list search.
This commit is contained in:
Zdenek Kabelac 2024-10-24 22:41:00 +02:00
parent 7d48c1f6e3
commit 87f68f443c

View File

@ -1671,6 +1671,11 @@ struct logical_volume *find_lv_in_vg_by_lvid(const struct volume_group *vg,
struct logical_volume *find_lv(const struct volume_group *vg,
const char *lv_name)
{
if (!vg->lv_names) {
struct lv_list *lvl = find_lv_in_vg(vg, lv_name);
return lvl ? lvl->lv : NULL;
}
return radix_tree_lookup_ptr(vg->lv_names, lv_name, strlen(lv_name));
}