mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
vdo: allow passing renamed vdopool name to kernel
Although kernel does not allow to load a new dm table with renamed vdopool, at least make lvm2 code ready it it every will get supported.
This commit is contained in:
parent
7c19186271
commit
50a37948b5
@ -1019,6 +1019,7 @@ int dm_tree_node_add_integrity_target(struct dm_tree_node *node,
|
||||
*/
|
||||
int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
|
||||
uint64_t size,
|
||||
const char *vdo_pool_name,
|
||||
const char *data_uuid,
|
||||
uint64_t data_size,
|
||||
const struct dm_vdo_target_params *param);
|
||||
|
@ -4360,6 +4360,7 @@ int dm_tree_node_add_cache_target_base(struct dm_tree_node *node,
|
||||
|
||||
int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
|
||||
uint64_t size,
|
||||
const char *vdo_pool_name,
|
||||
const char *data_uuid,
|
||||
uint64_t data_size,
|
||||
const struct dm_vdo_target_params *vtp)
|
||||
@ -4381,7 +4382,7 @@ int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
|
||||
return_0;
|
||||
|
||||
seg->vdo_params = *vtp;
|
||||
seg->vdo_name = node->name;
|
||||
seg->vdo_name = vdo_pool_name;
|
||||
seg->vdo_data_size = data_size;
|
||||
|
||||
node->props.send_messages = 2;
|
||||
|
@ -362,19 +362,21 @@ static int _vdo_pool_add_target_line(struct dev_manager *dm,
|
||||
struct dm_tree_node *node, uint64_t len,
|
||||
uint32_t *pvmove_mirror_count __attribute__((unused)))
|
||||
{
|
||||
char *data_uuid;
|
||||
char *vdo_pool_name, *data_uuid;
|
||||
|
||||
if (!seg_is_vdo_pool(seg)) {
|
||||
log_error(INTERNAL_ERROR "Passed segment is not VDO pool.");
|
||||
return 0;
|
||||
}
|
||||
if (!(vdo_pool_name = dm_build_dm_name(mem, seg->lv->vg->name, seg->lv->name, lv_layer(seg->lv))))
|
||||
return_0;
|
||||
|
||||
if (!(data_uuid = build_dm_uuid(mem, seg_lv(seg, 0), lv_layer(seg_lv(seg, 0)))))
|
||||
return_0;
|
||||
|
||||
/* VDO uses virtual size instead of its physical size */
|
||||
if (!dm_tree_node_add_vdo_target(node, get_vdo_pool_virtual_size(seg),
|
||||
data_uuid, seg_lv(seg, 0)->size,
|
||||
vdo_pool_name, data_uuid, seg_lv(seg, 0)->size,
|
||||
&seg->vdo_params))
|
||||
return_0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user