mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-30 17:18:21 +03:00
Revert "devices: simpler bcache invalidation of PVs on LVs"
This reverts commit 200b05cec0
.
Doesn't work to depend on lv name.
This commit is contained in:
parent
2f8550a388
commit
5f26c05bf2
@ -1366,13 +1366,17 @@ int dev_cache_update_dm_uuids(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* _cache.dm_devs entries are referenced by radix trees */
|
||||
|
||||
/* TODO: if _cache.dm_devs list is small, then skip the
|
||||
overhead of radix trees and just do list searches on dm_devs */
|
||||
|
||||
if (!(_cache.dm_devnos = radix_tree_create(NULL, NULL)) ||
|
||||
!(_cache.dm_uuids = radix_tree_create(NULL, NULL))) {
|
||||
return_0; // FIXME
|
||||
}
|
||||
|
||||
/* Insert every active DM device into radix trees */
|
||||
/* _cache.dm_devs entries are referenced by radix trees */
|
||||
dm_list_iterate_items(dm_dev, _cache.dm_devs) {
|
||||
d = _shuffle_devno(dm_dev->devno);
|
||||
|
||||
|
@ -1642,10 +1642,19 @@ void label_scan_invalidate(struct device *dev)
|
||||
|
||||
void label_scan_invalidate_lv(struct cmd_context *cmd, struct logical_volume *lv)
|
||||
{
|
||||
struct lvinfo lvinfo;
|
||||
struct device *dev;
|
||||
dev_t devt;
|
||||
|
||||
if ((dev = dev_cache_get_existing(cmd, display_lvname(lv), NULL)))
|
||||
label_scan_invalidate(dev);
|
||||
/* FIXME: use dev_cache_get_existing() with the lv name,
|
||||
which allow us to skip the getting devno from lv_info. */
|
||||
|
||||
if (lv_info(cmd, lv, 0, &lvinfo, 0, 0) && lvinfo.exists) {
|
||||
/* FIXME: Still unclear what is it supposed to find */
|
||||
devt = MKDEV(lvinfo.major, lvinfo.minor);
|
||||
if ((dev = dev_cache_get_by_devt(cmd, devt)))
|
||||
label_scan_invalidate(dev);
|
||||
}
|
||||
}
|
||||
|
||||
void label_scan_invalidate_lvs(struct cmd_context *cmd, struct dm_list *lvs)
|
||||
|
Loading…
Reference in New Issue
Block a user