mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
some fixes for mirrors
This commit is contained in:
parent
908db0785f
commit
24b026e333
@ -274,7 +274,8 @@ int dm_tree_deactivate_children(struct dm_tree_node *dnode,
|
|||||||
*/
|
*/
|
||||||
int dm_tree_preload_children(struct dm_tree_node *dnode,
|
int dm_tree_preload_children(struct dm_tree_node *dnode,
|
||||||
const char *uuid_prefix,
|
const char *uuid_prefix,
|
||||||
size_t uuid_prefix_len);
|
size_t uuid_prefix_len,
|
||||||
|
int resume_children);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resume a device plus all dependencies.
|
* Resume a device plus all dependencies.
|
||||||
|
@ -1357,7 +1357,8 @@ out:
|
|||||||
|
|
||||||
int dm_tree_preload_children(struct dm_tree_node *dnode,
|
int dm_tree_preload_children(struct dm_tree_node *dnode,
|
||||||
const char *uuid_prefix,
|
const char *uuid_prefix,
|
||||||
size_t uuid_prefix_len)
|
size_t uuid_prefix_len,
|
||||||
|
int resume_children)
|
||||||
{
|
{
|
||||||
void *handle = NULL;
|
void *handle = NULL;
|
||||||
struct dm_tree_node *child;
|
struct dm_tree_node *child;
|
||||||
@ -1376,7 +1377,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (dm_tree_node_num_children(child, 0))
|
if (dm_tree_node_num_children(child, 0))
|
||||||
dm_tree_preload_children(child, uuid_prefix, uuid_prefix_len);
|
dm_tree_preload_children(child, uuid_prefix, uuid_prefix_len, resume_children);
|
||||||
|
|
||||||
if (!(name = dm_tree_node_get_name(child))) {
|
if (!(name = dm_tree_node_get_name(child))) {
|
||||||
stack;
|
stack;
|
||||||
@ -1399,7 +1400,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Resume device immediately if it has parents */
|
/* Resume device immediately if it has parents */
|
||||||
if (!dm_tree_node_num_children(child, 1))
|
if (!resume_children || !dm_tree_node_num_children(child, 1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!_resume_node(name, child->info.major, child->info.minor, &newinfo)) {
|
if (!_resume_node(name, child->info.major, child->info.minor, &newinfo)) {
|
||||||
@ -1589,15 +1590,16 @@ int dm_tree_node_add_mirror_target_log(struct dm_tree_node *node,
|
|||||||
|
|
||||||
seg = list_item(list_last(&node->props.segs), struct load_segment);
|
seg = list_item(list_last(&node->props.segs), struct load_segment);
|
||||||
|
|
||||||
if (log_uuid && !(log_node = dm_tree_find_node_by_uuid(node->dtree, log_uuid))) {
|
if (log_uuid) {
|
||||||
|
if (!(log_node = dm_tree_find_node_by_uuid(node->dtree, log_uuid))) {
|
||||||
log_error("Couldn't find mirror log uuid %s.", log_uuid);
|
log_error("Couldn't find mirror log uuid %s.", log_uuid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
seg->log = log_node;
|
|
||||||
if (!_link_tree_nodes(node, log_node))
|
if (!_link_tree_nodes(node, log_node))
|
||||||
return_0;
|
return_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
seg->log = log_node;
|
||||||
seg->region_size = region_size;
|
seg->region_size = region_size;
|
||||||
seg->clustered = clustered;
|
seg->clustered = clustered;
|
||||||
seg->mirror_area_count = area_count;
|
seg->mirror_area_count = area_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user