mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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:
parent
d33f2e9f5a
commit
288adea256
@ -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)
|
||||
|
@ -99,6 +99,7 @@ static void _destroy(struct labeller *l)
|
||||
{
|
||||
struct pool *mem = (struct pool *) l->private;
|
||||
pool_destroy(mem);
|
||||
dbg_free(l);
|
||||
}
|
||||
|
||||
|
||||
|
@ -348,13 +348,12 @@ xx(vgcfgrestore,
|
||||
"\t[-l[l]|--list [--list]]" "\n"
|
||||
"\t[-n|--name VolumeGroupName] " "\n"
|
||||
"\t[-h|--help]" "\n"
|
||||
"\t[-o|--oldpath OldPhysicalVolumePath] " "\n"
|
||||
"\t[-t|--test] " "\n"
|
||||
"\t[-v|--verbose]" "\n"
|
||||
"\t[--version] " "\n"
|
||||
"[PhysicalVolumePath]\n",
|
||||
"\tVolumeGroupName",
|
||||
|
||||
file_ARG, list_ARG, name_ARG, oldpath_ARG, test_ARG)
|
||||
file_ARG, list_ARG, name_ARG, test_ARG)
|
||||
|
||||
xx(vgchange,
|
||||
"Change volume group attributes",
|
||||
|
@ -912,6 +912,7 @@ static void _exit_uuid_map(void)
|
||||
uuid_map_destroy(the_um);
|
||||
label_exit();
|
||||
_lvm1_label->ops->destroy(_lvm1_label);
|
||||
_lvm1_label = NULL;
|
||||
}
|
||||
|
||||
static int _get_env_vars(void)
|
||||
|
Loading…
Reference in New Issue
Block a user