mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pv: add 'mem' arg for pv_uuid_dup and pv_name_dup
This commit is contained in:
parent
ffa7b37b28
commit
f01b7afa19
@ -29,9 +29,9 @@ char *pv_fmt_dup(const struct physical_volume *pv)
|
||||
return dm_pool_strdup(pv->vg->vgmem, pv->fmt->name);
|
||||
}
|
||||
|
||||
char *pv_name_dup(const struct physical_volume *pv)
|
||||
char *pv_name_dup(struct dm_pool *mem, const struct physical_volume *pv)
|
||||
{
|
||||
return dm_pool_strdup(pv->vg->vgmem, dev_name(pv->dev));
|
||||
return dm_pool_strdup(mem ? mem : pv->vg->vgmem, dev_name(pv->dev));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -42,9 +42,9 @@ struct id pv_id(const struct physical_volume *pv)
|
||||
return pv_field(pv, id);
|
||||
}
|
||||
|
||||
char *pv_uuid_dup(const struct physical_volume *pv)
|
||||
char *pv_uuid_dup(struct dm_pool *mem, const struct physical_volume *pv)
|
||||
{
|
||||
return id_format_and_copy(pv->vg->vgmem, &pv->id);
|
||||
return id_format_and_copy(mem ? mem : pv->vg->vgmem, &pv->id);
|
||||
}
|
||||
|
||||
char *pv_tags_dup(const struct physical_volume *pv)
|
||||
|
@ -68,12 +68,12 @@ struct physical_volume {
|
||||
};
|
||||
|
||||
char *pv_fmt_dup(const struct physical_volume *pv);
|
||||
char *pv_name_dup(const struct physical_volume *pv);
|
||||
char *pv_name_dup(struct dm_pool *mem, const struct physical_volume *pv);
|
||||
struct device *pv_dev(const struct physical_volume *pv);
|
||||
const char *pv_vg_name(const struct physical_volume *pv);
|
||||
char *pv_attr_dup(struct dm_pool *mem, const struct physical_volume *pv);
|
||||
const char *pv_dev_name(const struct physical_volume *pv);
|
||||
char *pv_uuid_dup(const struct physical_volume *pv);
|
||||
char *pv_uuid_dup(struct dm_pool *mem, const struct physical_volume *pv);
|
||||
char *pv_tags_dup(const struct physical_volume *pv);
|
||||
uint64_t pv_size(const struct physical_volume *pv);
|
||||
uint64_t pv_size_field(const struct physical_volume *pv);
|
||||
|
@ -149,11 +149,11 @@ static dm_percent_t _metadata_percent(const struct logical_volume *lv)
|
||||
/* PV */
|
||||
GET_PV_STR_PROPERTY_FN(pv_fmt, pv_fmt_dup(pv))
|
||||
#define _pv_fmt_set prop_not_implemented_set
|
||||
GET_PV_STR_PROPERTY_FN(pv_uuid, pv_uuid_dup(pv))
|
||||
GET_PV_STR_PROPERTY_FN(pv_uuid, pv_uuid_dup(pv->vg->vgmem, pv))
|
||||
#define _pv_uuid_set prop_not_implemented_set
|
||||
GET_PV_NUM_PROPERTY_FN(dev_size, SECTOR_SIZE * pv_dev_size(pv))
|
||||
#define _dev_size_set prop_not_implemented_set
|
||||
GET_PV_STR_PROPERTY_FN(pv_name, pv_name_dup(pv))
|
||||
GET_PV_STR_PROPERTY_FN(pv_name, pv_name_dup(pv->vg->vgmem, pv))
|
||||
#define _pv_name_set prop_not_implemented_set
|
||||
GET_PV_NUM_PROPERTY_FN(pv_mda_free, SECTOR_SIZE * pv_mda_free(pv))
|
||||
#define _pv_mda_free_set prop_not_implemented_set
|
||||
|
@ -37,7 +37,7 @@ const char *lvm_pv_get_uuid(const pv_t pv)
|
||||
{
|
||||
const char *rc;
|
||||
struct saved_env e = store_user_env(pv->vg->cmd);
|
||||
rc = pv_uuid_dup(pv);
|
||||
rc = pv_uuid_dup(pv->vg->vgmem, pv);
|
||||
restore_user_env(&e);
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user