From: Zdenek Kabelac Date: Thu, 9 Nov 2023 14:51:51 +0000 (+0100) Subject: activate: use lv_layer X-Git-Tag: v2_03_24~424 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=b1e8af1c0c18ada68bf999eee743d4d0d1195050;p=lvm2.git activate: use lv_layer Avoid code duplication. --- diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 3a7b0ddd5..a4fedc81c 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -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) { - const char *layer; - - 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); + return build_dm_uuid(cmd->mem, lv, lv_layer(lv)); } static int _device_registered_with_dmeventd(struct cmd_context *cmd,