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

Make mempool optional in dm_split_lvm_name()

This commit is contained in:
Alasdair Kergon 2009-06-03 11:40:23 +00:00
parent b6deac338f
commit c9ee46569c
3 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.33 -
===============================
Make mempool optional in dm_split_lvm_name().
Version 1.02.32 - 21st May 2009
===============================

View File

@ -819,6 +819,8 @@ int dm_set_selinux_context(const char *path, mode_t mode);
/*
* Break up the name of a mapped device into its constituent
* Volume Group, Logical Volume and Layer (if present).
* If mem is supplied, the result is allocated from the mempool.
* Otherwise the strings are changed in situ.
*/
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
char **vgname, char **lvname, char **layer);

View File

@ -93,7 +93,7 @@ static char *_unquote(char *component)
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
char **vgname, char **lvname, char **layer)
{
if (!(*vgname = dm_pool_strdup(mem, dmname)))
if (mem && !(*vgname = dm_pool_strdup(mem, dmname)))
return 0;
_unquote(*layer = _unquote(*lvname = _unquote(*vgname)));