summaryrefslogtreecommitdiff
path: root/lib/mirror
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-02-09 23:40:37 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2018-02-12 22:15:03 +0100
commite113df129ebc4c2b4fca2a973ac6e06630e1a470 (patch)
treeec84bb860ae78db529e2b1c94c0fdc6dbc705b44 /lib/mirror
parent6dff5dc653a6f31c2e995beb1c5ca5c58e83515e (diff)
downloadlvm2-e113df129ebc4c2b4fca2a973ac6e06630e1a470.tar.gz
cleanup: decode dso path just once
Build dso plugin name during segtype initialisation and just use the string during command life-time. Also slightlt update message verbosity and make it very_verbose when operation is going to be made and 'verbose' when it's done.
Diffstat (limited to 'lib/mirror')
-rw-r--r--lib/mirror/mirrored.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c
index 012501ef0..16a58523a 100644
--- a/lib/mirror/mirrored.c
+++ b/lib/mirror/mirrored.c
@@ -480,22 +480,17 @@ static int _mirrored_target_present(struct cmd_context *cmd,
}
# ifdef DMEVENTD
-static const char *_get_mirror_dso_path(struct cmd_context *cmd)
-{
- return get_monitor_dso_path(cmd, find_config_tree_str(cmd, dmeventd_mirror_library_CFG, NULL));
-}
-
/* FIXME Cache this */
static int _target_registered(struct lv_segment *seg, int *pending, int *monitored)
{
- return target_registered_with_dmeventd(seg->lv->vg->cmd, _get_mirror_dso_path(seg->lv->vg->cmd),
+ return target_registered_with_dmeventd(seg->lv->vg->cmd, seg->segtype->dso,
seg->lv, pending, monitored);
}
/* FIXME This gets run while suspended and performs banned operations. */
static int _target_set_events(struct lv_segment *seg, int evmask, int set)
{
- return target_register_events(seg->lv->vg->cmd, _get_mirror_dso_path(seg->lv->vg->cmd),
+ return target_register_events(seg->lv->vg->cmd, seg->segtype->dso,
seg->lv, evmask, set, 0);
}
@@ -577,7 +572,10 @@ struct segment_type *init_segtype(struct cmd_context *cmd)
#ifdef DEVMAPPER_SUPPORT
# ifdef DMEVENTD
- if (_get_mirror_dso_path(cmd))
+ segtype->dso = get_monitor_dso_path(cmd,
+ find_config_tree_str(cmd, dmeventd_mirror_library_CFG, NULL));
+
+ if (segtype->dso)
segtype->flags |= SEG_MONITORED;
# endif /* DMEVENTD */
#endif