mirror of
git://sourceware.org/git/lvm2.git
synced 2025-10-18 03:33:15 +03:00
o missing labeller free
o updated vgcfgrestore args o change _check_for_open_devices only to check devices present in the hash table instead of using dev_iter which triggers a full scan even when only displaying command line help
This commit is contained in:
@@ -298,25 +298,17 @@ int dev_cache_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
iterate_fn _check_closed(void *data)
|
||||
{
|
||||
struct device *dev = (struct device *) data;
|
||||
|
||||
if (dev->fd >= 0)
|
||||
log_err("Device '%s' has been left open.", dev_name(dev));
|
||||
}
|
||||
|
||||
static inline void _check_for_open_devices(void)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
struct dev_iter *i = dev_iter_create(NULL);
|
||||
struct device *dev;
|
||||
|
||||
if (!i) {
|
||||
stack;
|
||||
return;
|
||||
}
|
||||
|
||||
while ((dev = dev_iter_get(i))) {
|
||||
if (dev->fd >= 0)
|
||||
log_err("Device '%s' has been left open.",
|
||||
dev_name(dev));
|
||||
}
|
||||
|
||||
dev_iter_destroy(i);
|
||||
#endif
|
||||
hash_iterate(_cache.names, _check_closed);
|
||||
}
|
||||
|
||||
void dev_cache_exit(void)
|
||||
|
Reference in New Issue
Block a user