1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

activate: use lv_layer

Avoid code duplication.
This commit is contained in:
Zdenek Kabelac 2023-11-09 15:51:51 +01:00
parent b69f73b13e
commit b1e8af1c0c

View File

@ -1606,18 +1606,7 @@ char *get_monitor_dso_path(struct cmd_context *cmd, int id)
static char *_build_target_uuid(struct cmd_context *cmd, const struct logical_volume *lv) static char *_build_target_uuid(struct cmd_context *cmd, const struct logical_volume *lv)
{ {
const char *layer; return build_dm_uuid(cmd->mem, lv, lv_layer(lv));
if (lv_is_thin_pool(lv))
layer = "tpool"; /* Monitor "tpool" for the "thin pool". */
else if (lv_is_vdo_pool(lv))
layer = "vpool"; /* Monitor "vpool" for the "VDO pool". */
else if (lv_is_origin(lv) || lv_is_external_origin(lv))
layer = "real"; /* Monitor "real" for "snapshot-origin". */
else
layer = NULL;
return build_dm_uuid(cmd->mem, lv, layer);
} }
static int _device_registered_with_dmeventd(struct cmd_context *cmd, static int _device_registered_with_dmeventd(struct cmd_context *cmd,