From: David Teigland Date: Fri, 20 Sep 2019 14:46:03 +0000 (-0500) Subject: cachevol: add dm uuid suffixes to hidden lvs X-Git-Tag: v2_03_06~117 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=515e37b6dd352bd71e63bdef24fc13e2ee75ff98;p=lvm2.git cachevol: add dm uuid suffixes to hidden lvs to indicate they are private lvm devs --- diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 5ee5efe20..b85237d28 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -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"))) diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index 20a426138..798b157c3 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -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; } diff --git a/lib/misc/lvm-string.c b/lib/misc/lvm-string.c index fe24f23d7..b7c1c121e 100644 --- a/lib/misc/lvm-string.c +++ b/lib/misc/lvm-string.c @@ -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" :