summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2002-01-15 21:28:04 +0000
committerAlasdair Kergon <agk@redhat.com>2002-01-15 21:28:04 +0000
commit288adea256dba2ef2119481dc410e486ccd54f3a (patch)
tree75fdc3f05042380004b2a0b1c3747a770d3706d1
parentd33f2e9f5a47ba6c5783a5b81c12e2621cd6e29a (diff)
downloadlvm2-288adea256dba2ef2119481dc410e486ccd54f3a.tar.gz
lvm2-288adea256dba2ef2119481dc410e486ccd54f3a.tar.xz
lvm2-288adea256dba2ef2119481dc410e486ccd54f3a.zip
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
-rw-r--r--lib/device/dev-cache.c24
-rw-r--r--lib/format1/lvm1_label.c1
-rw-r--r--tools/commands.h5
-rw-r--r--tools/lvm.c1
4 files changed, 12 insertions, 19 deletions
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 6b8ee4b3..ca1f1d56 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -298,25 +298,17 @@ int dev_cache_init(void)
return 0;
}
-static inline void _check_for_open_devices(void)
+iterate_fn _check_closed(void *data)
{
-#ifndef NDEBUG
- struct dev_iter *i = dev_iter_create(NULL);
- struct device *dev;
-
- if (!i) {
- stack;
- return;
- }
+ struct device *dev = (struct device *) data;
- while ((dev = dev_iter_get(i))) {
- if (dev->fd >= 0)
- log_err("Device '%s' has been left open.",
- dev_name(dev));
- }
+ if (dev->fd >= 0)
+ log_err("Device '%s' has been left open.", dev_name(dev));
+}
- dev_iter_destroy(i);
-#endif
+static inline void _check_for_open_devices(void)
+{
+ hash_iterate(_cache.names, _check_closed);
}
void dev_cache_exit(void)
diff --git a/lib/format1/lvm1_label.c b/lib/format1/lvm1_label.c
index 60766c43..06c6d582 100644
--- a/lib/format1/lvm1_label.c
+++ b/lib/format1/lvm1_label.c
@@ -99,6 +99,7 @@ static void _destroy(struct labeller *l)
{
struct pool *mem = (struct pool *) l->private;
pool_destroy(mem);
+ dbg_free(l);
}
diff --git a/tools/commands.h b/tools/commands.h
index af5250ac..95d4710d 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -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",
diff --git a/tools/lvm.c b/tools/lvm.c
index 8cebf2df..17a658c7 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -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)