]> sourceware.org Git - lvm2.git/commitdiff
activate: use lv_layer
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 9 Nov 2023 14:51:51 +0000 (15:51 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 10 Jan 2024 13:02:22 +0000 (14:02 +0100)
Avoid code duplication.

lib/activate/activate.c

index 3a7b0ddd57dc73ce74874cb9b1fe38b52299a0f0..a4fedc81cf4cb1e937962d68a3aeb852841a5f91 100644 (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)
 {
-       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,
This page took 0.034331 seconds and 5 git commands to generate.