mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
debug: for checking how find_lv works
To see whether use of 'radix_tree' for every find_lv() call helps. As if we drop radix_tree after import, this code then may fallback to old slower find_lv_in_vg.
This commit is contained in:
parent
785572fb65
commit
1ddc36b5b6
@ -1324,6 +1324,12 @@ static struct volume_group *_read_vg(struct cmd_context *cmd,
|
||||
vg->pv_names = NULL; /* PV names are no longer valid outside of _read_vg() */
|
||||
}
|
||||
|
||||
if (0 && vg->lv_names) {
|
||||
/* TODO: update also rename function to keep lv_names always valid and usable */
|
||||
radix_tree_destroy(vg->lv_names);
|
||||
vg->lv_names = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Finished.
|
||||
*/
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user