mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
dev-cache: Make it possible to pass in a NULL filter.
This commit is contained in:
parent
012d273ede
commit
72d82e21d4
@ -971,21 +971,23 @@ struct dev_iter *dev_iter_create(struct dev_filter *f, int dev_scan)
|
|||||||
|
|
||||||
if (dev_scan && !trust_cache()) {
|
if (dev_scan && !trust_cache()) {
|
||||||
/* Flag gets reset between each command */
|
/* Flag gets reset between each command */
|
||||||
if (!full_scan_done())
|
if (!full_scan_done() && f)
|
||||||
persistent_filter_wipe(f); /* Calls _full_scan(1) */
|
persistent_filter_wipe(f); /* Calls _full_scan(1) */
|
||||||
} else
|
} else
|
||||||
_full_scan(0);
|
_full_scan(0);
|
||||||
|
|
||||||
di->current = btree_first(_cache.devices);
|
di->current = btree_first(_cache.devices);
|
||||||
di->filter = f;
|
di->filter = f;
|
||||||
di->filter->use_count++;
|
if (di->filter)
|
||||||
|
di->filter->use_count++;
|
||||||
|
|
||||||
return di;
|
return di;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dev_iter_destroy(struct dev_iter *iter)
|
void dev_iter_destroy(struct dev_iter *iter)
|
||||||
{
|
{
|
||||||
iter->filter->use_count--;
|
if (iter->filter)
|
||||||
|
iter->filter->use_count--;
|
||||||
dm_free(iter);
|
dm_free(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user