mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dev_manager: refactor
Use struct initilizer to setup lvid.
This commit is contained in:
parent
9718fd2496
commit
abc1b44d8d
@ -2674,13 +2674,14 @@ static int _add_cvol_subdev_to_dtree(struct dev_manager *dm, struct dm_tree *dtr
|
|||||||
struct lv_segment *lvseg = first_seg(lv);
|
struct lv_segment *lvseg = first_seg(lv);
|
||||||
struct dm_info info;
|
struct dm_info info;
|
||||||
char *name ,*dlid;
|
char *name ,*dlid;
|
||||||
union lvid lvid = { { { "" } } };
|
union lvid lvid = {
|
||||||
|
{
|
||||||
memcpy(&lvid.id[0], &lv->vg->id, sizeof(struct id));
|
lv->vg->id,
|
||||||
/* When ID is provided in form of metadata_id or data_id, otherwise use CVOL ID */
|
/* When ID is provided in form of metadata_id or data_id, otherwise use CVOL ID */
|
||||||
memcpy(&lvid.id[1],
|
(meta_or_data && lvseg->metadata_id) ? *lvseg->metadata_id :
|
||||||
(meta_or_data && lvseg->metadata_id) ? lvseg->metadata_id :
|
(lvseg->data_id) ? *lvseg->data_id : pool_lv->lvid.id[1]
|
||||||
(lvseg->data_id) ? lvseg->data_id : &pool_lv->lvid.id[1], sizeof(struct id));
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (!(dlid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&lvid.s, layer)))
|
if (!(dlid = dm_build_dm_uuid(mem, UUID_PREFIX, (const char *)&lvid.s, layer)))
|
||||||
return_0;
|
return_0;
|
||||||
|
Loading…
Reference in New Issue
Block a user