mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
Use dm_malloc and dm_free in liblvm instead of malloc/free.
This commit is contained in:
parent
9c2e73fdd2
commit
98418e2b6e
24
liblvm/lvm.h
24
liblvm/lvm.h
@ -407,8 +407,8 @@ int lvm_vg_set_extent_size(vg_t *vg, uint32_t new_size);
|
|||||||
/**
|
/**
|
||||||
* Get the current name of a volume group.
|
* Get the current name of a volume group.
|
||||||
*
|
*
|
||||||
* Memory is allocated using malloc() and caller must free the memory
|
* Memory is allocated using dm_malloc() and caller must free the memory
|
||||||
* using free().
|
* using dm_free().
|
||||||
*
|
*
|
||||||
* \param vg
|
* \param vg
|
||||||
* VG handle obtained from lvm_vg_create or lvm_vg_open.
|
* VG handle obtained from lvm_vg_create or lvm_vg_open.
|
||||||
@ -419,8 +419,8 @@ char *lvm_vg_get_uuid(const vg_t *vg);
|
|||||||
/**
|
/**
|
||||||
* Get the current uuid of a volume group.
|
* Get the current uuid of a volume group.
|
||||||
*
|
*
|
||||||
* Memory is allocated using malloc() and caller must free the memory
|
* Memory is allocated using dm_malloc() and caller must free the memory
|
||||||
* using free().
|
* using dm_free().
|
||||||
*
|
*
|
||||||
* \param vg
|
* \param vg
|
||||||
* VG handle obtained from lvm_vg_create or lvm_vg_open.
|
* VG handle obtained from lvm_vg_create or lvm_vg_open.
|
||||||
@ -557,8 +557,8 @@ int lvm_vg_remove_lv(lv_t *lv);
|
|||||||
/**
|
/**
|
||||||
* Get the current name of a logical volume.
|
* Get the current name of a logical volume.
|
||||||
*
|
*
|
||||||
* Memory is allocated using malloc() and caller must free the memory
|
* Memory is allocated using dm_malloc() and caller must free the memory
|
||||||
* using free().
|
* using dm_free().
|
||||||
*
|
*
|
||||||
* \param lv
|
* \param lv
|
||||||
* Logical volume handle.
|
* Logical volume handle.
|
||||||
@ -569,8 +569,8 @@ char *lvm_lv_get_uuid(const lv_t *lv);
|
|||||||
/**
|
/**
|
||||||
* Get the current uuid of a logical volume.
|
* Get the current uuid of a logical volume.
|
||||||
*
|
*
|
||||||
* Memory is allocated using malloc() and caller must free the memory
|
* Memory is allocated using dm_malloc() and caller must free the memory
|
||||||
* using free().
|
* using dm_free().
|
||||||
*
|
*
|
||||||
* \param lv
|
* \param lv
|
||||||
* Logical volume handle.
|
* Logical volume handle.
|
||||||
@ -638,8 +638,8 @@ struct dm_list *lvm_vg_list_pvs(vg_t *vg);
|
|||||||
/**
|
/**
|
||||||
* Get the current uuid of a logical volume.
|
* Get the current uuid of a logical volume.
|
||||||
*
|
*
|
||||||
* Memory is allocated using malloc() and caller must free the memory
|
* Memory is allocated using dm_malloc() and caller must free the memory
|
||||||
* using free().
|
* using dm_free().
|
||||||
*
|
*
|
||||||
* \param pv
|
* \param pv
|
||||||
* Physical volume handle.
|
* Physical volume handle.
|
||||||
@ -650,8 +650,8 @@ char *lvm_pv_get_uuid(const pv_t *pv);
|
|||||||
/**
|
/**
|
||||||
* Get the current name of a logical volume.
|
* Get the current name of a logical volume.
|
||||||
*
|
*
|
||||||
* Memory is allocated using malloc() and caller must free the memory
|
* Memory is allocated using dm_malloc() and caller must free the memory
|
||||||
* using free().
|
* using dm_free().
|
||||||
*
|
*
|
||||||
* \param pv
|
* \param pv
|
||||||
* Physical volume handle.
|
* Physical volume handle.
|
||||||
|
@ -44,7 +44,7 @@ char *lvm_lv_get_name(const lv_t *lv)
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
name = malloc(NAME_LEN + 1);
|
name = dm_malloc(NAME_LEN + 1);
|
||||||
strncpy(name, (const char *)lv->name, NAME_LEN);
|
strncpy(name, (const char *)lv->name, NAME_LEN);
|
||||||
name[NAME_LEN] = '\0';
|
name[NAME_LEN] = '\0';
|
||||||
return name;
|
return name;
|
||||||
|
@ -32,7 +32,7 @@ char *lvm_pv_get_name(const pv_t *pv)
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
name = malloc(NAME_LEN + 1);
|
name = dm_malloc(NAME_LEN + 1);
|
||||||
strncpy(name, (const char *)pv_dev_name(pv), NAME_LEN);
|
strncpy(name, (const char *)pv_dev_name(pv), NAME_LEN);
|
||||||
name[NAME_LEN] = '\0';
|
name[NAME_LEN] = '\0';
|
||||||
return name;
|
return name;
|
||||||
|
@ -269,7 +269,7 @@ char *lvm_vg_get_name(const vg_t *vg)
|
|||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
name = malloc(NAME_LEN + 1);
|
name = dm_malloc(NAME_LEN + 1);
|
||||||
strncpy(name, (const char *)vg->name, NAME_LEN);
|
strncpy(name, (const char *)vg->name, NAME_LEN);
|
||||||
name[NAME_LEN] = '\0';
|
name[NAME_LEN] = '\0';
|
||||||
return name;
|
return name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user