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

lv: add 'mem' arg for lv_uuid_dup

This commit is contained in:
Peter Rajnoha 2015-09-21 12:23:03 +02:00
parent f644431346
commit 0e3042f488
4 changed files with 5 additions and 5 deletions

View File

@ -479,9 +479,9 @@ char *lv_dmpath_dup(struct dm_pool *mem, const struct logical_volume *lv)
return repstr; return repstr;
} }
char *lv_uuid_dup(const struct logical_volume *lv) char *lv_uuid_dup(struct dm_pool *mem, const struct logical_volume *lv)
{ {
return id_format_and_copy(lv->vg->vgmem, &lv->lvid.id[1]); return id_format_and_copy(mem ? mem : lv->vg->vgmem, &lv->lvid.id[1]);
} }
char *lv_tags_dup(const struct logical_volume *lv) char *lv_tags_dup(const struct logical_volume *lv)

View File

@ -62,7 +62,7 @@ uint64_t lv_size(const struct logical_volume *lv);
uint64_t lv_metadata_size(const struct logical_volume *lv); uint64_t lv_metadata_size(const struct logical_volume *lv);
char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_with_info_and_seg_status *lvdm); char *lv_attr_dup_with_info_and_seg_status(struct dm_pool *mem, const struct lv_with_info_and_seg_status *lvdm);
char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv); char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv);
char *lv_uuid_dup(const struct logical_volume *lv); char *lv_uuid_dup(struct dm_pool *mem, const struct logical_volume *lv);
char *lv_tags_dup(const struct logical_volume *lv); char *lv_tags_dup(const struct logical_volume *lv);
char *lv_path_dup(struct dm_pool *mem, const struct logical_volume *lv); char *lv_path_dup(struct dm_pool *mem, const struct logical_volume *lv);
char *lv_dmpath_dup(struct dm_pool *mem, const struct logical_volume *lv); char *lv_dmpath_dup(struct dm_pool *mem, const struct logical_volume *lv);

View File

@ -264,7 +264,7 @@ GET_PV_NUM_PROPERTY_FN(pv_ba_size, SECTOR_SIZE * pv->ba_size)
#define _cache_write_misses_get prop_not_implemented_get #define _cache_write_misses_get prop_not_implemented_get
/* LV */ /* LV */
GET_LV_STR_PROPERTY_FN(lv_uuid, lv_uuid_dup(lv)) GET_LV_STR_PROPERTY_FN(lv_uuid, lv_uuid_dup(lv->vg->vgmem, lv))
#define _lv_uuid_set prop_not_implemented_set #define _lv_uuid_set prop_not_implemented_set
GET_LV_STR_PROPERTY_FN(lv_name, lv_name_dup(lv->vg->vgmem, lv)) GET_LV_STR_PROPERTY_FN(lv_name, lv_name_dup(lv->vg->vgmem, lv))
#define _lv_name_set prop_not_implemented_set #define _lv_name_set prop_not_implemented_set

View File

@ -56,7 +56,7 @@ const char *lvm_lv_get_uuid(const lv_t lv)
{ {
const char *rc; const char *rc;
struct saved_env e = store_user_env(lv->vg->cmd); struct saved_env e = store_user_env(lv->vg->cmd);
rc = lv_uuid_dup(lv); rc = lv_uuid_dup(lv->vg->vgmem, lv);
restore_user_env(&e); restore_user_env(&e);
return rc; return rc;
} }