]> sourceware.org Git - lvm2.git/commitdiff
cachevol: add dm uuid suffixes to hidden lvs
authorDavid Teigland <teigland@redhat.com>
Fri, 20 Sep 2019 14:46:03 +0000 (09:46 -0500)
committerDavid Teigland <teigland@redhat.com>
Fri, 20 Sep 2019 14:59:37 +0000 (09:59 -0500)
to indicate they are private lvm devs

lib/activate/dev_manager.c
lib/cache_segtype/cache.c
lib/misc/lvm-string.c

index 5ee5efe20524815647393ab9f9552157b4933d2c..b85237d2841b9e567eb071bcd8997916c9794033 100644 (file)
@@ -46,7 +46,7 @@ typedef enum {
 } action_t;
 
 /* This list must match lib/misc/lvm-string.c:build_dm_uuid(). */
-const char *uuid_suffix_list[] = { "pool", "cdata", "cmeta", "tdata", "tmeta", "vdata", "vpool", NULL};
+const char *uuid_suffix_list[] = { "pool", "cdata", "cmeta", "tdata", "tmeta", "vdata", "vpool", "cvol", NULL};
 
 struct dlid_list {
        struct dm_list list;
@@ -859,9 +859,9 @@ int get_cache_vol_meta_data(struct cmd_context *cmd,
        memcpy(&lvid_data.id[0], &lv->vg->id, sizeof(struct id));
        memcpy(&lvid_data.id[1], &lvseg->data_id, sizeof(struct id));
 
-       if (!(dlid_meta = dm_build_dm_uuid(cmd->mem, UUID_PREFIX, (const char *)&lvid_meta.s, NULL)))
+       if (!(dlid_meta = dm_build_dm_uuid(cmd->mem, UUID_PREFIX, (const char *)&lvid_meta.s, "cmeta")))
                return_0;
-       if (!(dlid_data = dm_build_dm_uuid(cmd->mem, UUID_PREFIX, (const char *)&lvid_data.s, NULL)))
+       if (!(dlid_data = dm_build_dm_uuid(cmd->mem, UUID_PREFIX, (const char *)&lvid_data.s, "cdata")))
                return_0;
        if (!(name_meta = dm_build_dm_name(cmd->mem, lv->vg->name, pool_lv->name, "_cmeta")))
                return_0;
@@ -2500,9 +2500,9 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
                memcpy(&lvid_data.id[0], &lv->vg->id, sizeof(struct id));
                memcpy(&lvid_data.id[1], &lvseg->data_id, sizeof(struct id));
 
-               if (!(dlid_meta = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_meta.s, NULL)))
+               if (!(dlid_meta = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_meta.s, "cmeta")))
                        return_0;
-               if (!(dlid_data = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_data.s, NULL)))
+               if (!(dlid_data = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_data.s, "cdata")))
                        return_0;
                if (!(name_meta = dm_build_dm_name(dm->mem, lv->vg->name, pool_lv->name, "_cmeta")))
                        return_0;
@@ -3242,9 +3242,9 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
                memcpy(&lvid_data.id[0], &vg->id, sizeof(struct id));
                memcpy(&lvid_data.id[1], &lvseg->data_id, sizeof(struct id));
 
-               if (!(dlid_meta = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_meta.s, NULL)))
+               if (!(dlid_meta = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_meta.s, "cmeta")))
                        return_0;
-               if (!(dlid_data = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_data.s, NULL)))
+               if (!(dlid_data = dm_build_dm_uuid(dm->mem, UUID_PREFIX, (const char *)&lvid_data.s, "cdata")))
                        return_0;
 
                if (!(name_meta = dm_build_dm_name(dm->mem, vg->name, pool_lv->name, "_cmeta")))
index 20a426138230a1713cb390b94a24a5efa4badd4c..798b157c336f5f42aceda2f5a060c5efe09de21a 100644 (file)
@@ -699,9 +699,9 @@ static int _cache_add_target_line(struct dev_manager *dm,
                memcpy(&data_lvid.id[0], &seg->lv->vg->id, sizeof(struct id));
                memcpy(&data_lvid.id[1], &seg->data_id, sizeof(struct id));
 
-               if (!(metadata_uuid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&metadata_lvid.s, NULL)))
+               if (!(metadata_uuid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&metadata_lvid.s, "cmeta")))
                        return_0;
-               if (!(data_uuid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&data_lvid.s, NULL)))
+               if (!(data_uuid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&data_lvid.s, "cdata")))
                        return_0;
        }
 
index fe24f23d725cc1de9281acfc876667de31cf995d..b7c1c121e842ea2cd3aa81d4c0daf57b2c0b9eca 100644 (file)
@@ -157,6 +157,7 @@ static const char *_lvname_has_reserved_component_string(const char *lvname)
                "_cdata",
                "_cmeta",
                "_corig",
+               "_cvol",
                "_mimage",
                "_mlog",
                "_rimage",
@@ -251,6 +252,7 @@ char *build_dm_uuid(struct dm_pool *mem, const struct logical_volume *lv,
                        (lv_is_cache(lv) && lv_is_pending_delete(lv)) ? "real" :
                        lv_is_cache_pool_data(lv) ? "cdata" :
                        lv_is_cache_pool_metadata(lv) ? "cmeta" :
+                       lv_is_cache_vol(lv) ? "cvol" :
                        // FIXME: dm-tree needs fixes for mirrors/raids
                        //lv_is_mirror_image(lv) ? "mimage" :
                        //lv_is_mirror_log(lv) ? "mlog" :
This page took 0.042639 seconds and 5 git commands to generate.