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:
parent
1cd292af8f
commit
b184f791d4
@ -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
|
||||
*/
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user