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

Add pv_name_dup() and pv_fmt_dup() helper functions.

This commit is contained in:
Dave Wysochanski 2010-09-30 14:09:22 +00:00
parent 1cd292af8f
commit b184f791d4
2 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,18 @@
*/
#define pv_field(handle, field) ((handle)->field)
char *pv_fmt_dup(const struct physical_volume *pv)
{
if (!pv->fmt)
return NULL;
return dm_pool_strdup(pv->vg->vgmem, pv->fmt->name);
}
char *pv_name_dup(const struct physical_volume *pv)
{
return dm_pool_strdup(pv->vg->vgmem, dev_name(pv->dev));
}
/*
* Gets/Sets for external LVM library
*/

View File

@ -52,6 +52,8 @@ struct physical_volume {
struct dm_list tags;
};
char *pv_fmt_dup(const struct physical_volume *pv);
char *pv_name_dup(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);