1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

libdm: support for posting messages in suspend

Add support for sending message in suspend tree for thin-pools.
When this operation is requested whole subtree suspend is then skipped.

This is experimantal support for new lvm2 code for sending message
in suspend phase where 'thin-pool origin-only suspend' will send
messages instead of really suspending thin-pool tree.

When suspening thin volume origin-only - only thin volume is suspended,
then messages are posted and thin-pool suspend is skipped.
This commit is contained in:
Zdenek Kabelac 2015-07-01 13:30:14 +02:00
parent 622064f00f
commit 5bef18f2eb
2 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.101 -
=================================
Add experimental support to passing messages in suspend tree.
Add dm_report_value_cache_{set,get} to support caching during report/select.
Add dm_report_reserved_handler to handle report reserved value actions.
Support dynamic value in select: DM_REPORT_FIELD_RESERVED_VALUE_DYNAMIC_VALUE.

View File

@ -243,6 +243,8 @@ struct load_properties {
/* Send messages for this node in preload */
unsigned send_messages;
/* Skip suspending node's children, used when sending messages to thin-pool */
int skip_suspend;
};
/* Two of these used to join two nodes with uses and used_by. */
@ -1768,6 +1770,19 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
!info.exists || info.suspended)
continue;
/* If child has some real messages send them */
if ((child->props.send_messages > 1) && r) {
if (!(r = _node_send_messages(child, uuid_prefix, uuid_prefix_len, 1)))
stack;
else {
log_debug_activation("Sent messages to thin-pool %s."
"skipping suspend of its children.",
_node_name(child));
child->props.skip_suspend++;
}
continue;
}
if (!_suspend_node(name, info.major, info.minor,
child->dtree->skip_lockfs,
child->dtree->no_flush, &newinfo)) {
@ -1786,6 +1801,9 @@ int dm_tree_suspend_children(struct dm_tree_node *dnode,
handle = NULL;
while ((child = dm_tree_next_child(&handle, dnode, 0))) {
if (child->props.skip_suspend)
continue;
if (!(uuid = dm_tree_node_get_uuid(child))) {
stack;
continue;