summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2001-12-13 00:07:29 +0000
committerAlasdair Kergon <agk@redhat.com>2001-12-13 00:07:29 +0000
commitfaa556e75922e2992a17c9ada4e1fd1c884847b6 (patch)
tree3d5a324b15f371c41e20d49665615af34495294c /tools
parent394fae7fc50f36432ae6e2cb66bcfa30258415c5 (diff)
downloadlvm2-faa556e75922e2992a17c9ada4e1fd1c884847b6.tar.gz
lvm2-faa556e75922e2992a17c9ada4e1fd1c884847b6.tar.xz
lvm2-faa556e75922e2992a17c9ada4e1fd1c884847b6.zip
Add internal cache holding a 'hint' list of the PVs belonging to each VG.
A substantial speed-up - particularly in readline mode. If the hints turn out to be wrong, the relevant parts get thrown away. vgscan destroys it totally. In both cases it then rebuilds itself as required.
Diffstat (limited to 'tools')
-rw-r--r--tools/lvm.c2
-rw-r--r--tools/vgscan.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/tools/lvm.c b/tools/lvm.c
index f1424463..f10101b3 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -29,6 +29,7 @@
#include <ctype.h>
#include "stub.h"
+#include "vgcache.h"
#ifdef READLINE_SUPPORT
#include <readline/readline.h>
@@ -792,6 +793,7 @@ static void fin(void)
fid->ops->destroy(fid);
cmd->filter->destroy(cmd->filter);
pool_destroy(cmd->mem);
+ vgcache_destroy();
dev_cache_exit();
destroy_config_file(cmd->cf);
dbg_free(cmd);
diff --git a/tools/vgscan.c b/tools/vgscan.c
index 420fa29d..5ca6999c 100644
--- a/tools/vgscan.c
+++ b/tools/vgscan.c
@@ -29,8 +29,11 @@ int vgscan(int argc, char **argv)
return EINVALID_CMD_LINE;
}
- log_verbose("Wiping cache of LVM-capable devices");
- persistent_filter_wipe(fid->cmd->filter);
+ log_verbose("Wiping cache of LVM-capable devices");
+ persistent_filter_wipe(fid->cmd->filter);
+
+ log_verbose("Wiping internal cache of PVs in VGs");
+ vgcache_destroy();
log_print("Reading all physical volumes (this may take a while...)");
@@ -62,9 +65,7 @@ static int vgscan_single(const char *vg_name)
}
*********/
-
-
- log_print("%d logical volumes in volume group %s activated",
+ log_print("%d logical volumes in volume group %s activated",
activate_lvs_in_vg(vg), vg_name);
return 0;