summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2012-08-13 19:44:10 +0200
committerPetr Rockai <prockai@redhat.com>2012-09-26 14:49:15 +0200
commitc7b17836ea139ba7448f5a5c1d2fbe93676baa36 (patch)
treee588286f8a35aaef2e111975919d9e01d1407586 /tools
parentceb79c9a500f38ac31c8d79904c3730805feb3dc (diff)
downloadlvm2-c7b17836ea139ba7448f5a5c1d2fbe93676baa36.tar.gz
lvm2-c7b17836ea139ba7448f5a5c1d2fbe93676baa36.tar.xz
lvm2-c7b17836ea139ba7448f5a5c1d2fbe93676baa36.zip
Implement devices/global_filter.
The global filter is applied first, and is also applied in pvscan --cache (which is called from udev rules to keep lvmetad updated). Cf. example.conf.
Diffstat (limited to 'tools')
-rw-r--r--tools/pvscan.c31
-rw-r--r--tools/vgrename.c3
-rw-r--r--tools/vgscan.c3
3 files changed, 7 insertions, 30 deletions
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 92873882..239ce978 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -106,32 +106,6 @@ static int _auto_activation_handler(struct volume_group *vg, int partial,
return 1;
}
-static int _pvscan_lvmetad_all_devs(struct cmd_context *cmd, activation_handler handler)
-{
- struct dev_iter *iter;
- struct device *dev;
- int r = 1;
-
- if (!(iter = dev_iter_create(cmd->filter, 1))) {
- log_error("dev_iter creation failed");
- return 0;
- }
-
- while ((dev = dev_iter_get(iter))) {
- if (!pvscan_lvmetad_single(cmd, dev, handler)) {
- r = 0;
- break;
- }
-
- if (sigint_caught())
- break;
- }
-
- dev_iter_destroy(iter);
-
- return r;
-}
-
static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
{
int ret = ECMD_PROCESSED;
@@ -168,7 +142,7 @@ static int _pvscan_lvmetad(struct cmd_context *cmd, int argc, char **argv)
/* Scan everything? */
if (!argc && !devno_args) {
- if (!_pvscan_lvmetad_all_devs(cmd, handler))
+ if (!pvscan_lvmetad_all_devs(cmd, handler))
ret = ECMD_FAILED;
goto out;
}
@@ -283,7 +257,8 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- persistent_filter_wipe(cmd->filter);
+ if (cmd->filter->wipe)
+ cmd->filter->wipe(cmd->filter);
lvmcache_destroy(cmd, 1);
/* populate lvmcache */
diff --git a/tools/vgrename.c b/tools/vgrename.c
index 451d0854..b4766024 100644
--- a/tools/vgrename.c
+++ b/tools/vgrename.c
@@ -181,7 +181,8 @@ static int vg_rename_path(struct cmd_context *cmd, const char *old_vg_path,
vg_name_old, vg_name_new);
/* FIXME lvmcache corruption - vginfo duplicated instead of renamed */
- persistent_filter_wipe(cmd->filter);
+ if (cmd->filter->wipe)
+ cmd->filter->wipe(cmd->filter);
lvmcache_destroy(cmd, 1);
return 1;
diff --git a/tools/vgscan.c b/tools/vgscan.c
index a34f3ba1..8deafb64 100644
--- a/tools/vgscan.c
+++ b/tools/vgscan.c
@@ -50,7 +50,8 @@ int vgscan(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- persistent_filter_wipe(cmd->filter);
+ if (cmd->filter->wipe)
+ cmd->filter->wipe(cmd->filter);
lvmcache_destroy(cmd, 1);
_lvmetad = lvmetad_active();