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

Use generic name for message sending function

Drop _thin_pool prefix for _node_send_message so it could be extended later.
Replace current_id with trans_id name.
This commit is contained in:
Zdenek Kabelac 2011-10-19 16:40:59 +00:00
parent 8de912b677
commit 11f64f0aeb

View File

@ -1328,17 +1328,17 @@ out:
return r;
}
static int _thin_pool_node_send_messages(struct dm_tree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len)
static int _node_send_messages(struct dm_tree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len)
{
struct load_segment *seg;
struct thin_message *tmsg;
uint64_t current_id;
uint64_t trans_id;
const char *uuid;
if ((dnode == &dnode->dtree->root) || /* root has rops.segs uninitialized */
(dm_list_size(&dnode->props.segs) != 1))
if ((dnode == &dnode->dtree->root) || /* root has props.segs uninitialized */
!dnode->info.exists || (dm_list_size(&dnode->props.segs) != 1))
return 1;
seg = dm_list_item(dm_list_last(&dnode->props.segs), struct load_segment);
@ -1353,16 +1353,15 @@ static int _thin_pool_node_send_messages(struct dm_tree_node *dnode,
return 1;
}
if (!_thin_pool_status_transaction_id(dnode, &current_id))
if (!_thin_pool_status_transaction_id(dnode, &trans_id))
return_0;
log_debug("Expecting transaction_id: %" PRIu64, dnode->props.thin_pool_transaction_id);
if (current_id == dnode->props.thin_pool_transaction_id)
if (trans_id == dnode->props.thin_pool_transaction_id)
return 1; /* In sync - skip messages */
if (current_id != (dnode->props.thin_pool_transaction_id - 1)) {
if (trans_id != (dnode->props.thin_pool_transaction_id - 1)) {
log_error("Thin pool transaction_id=%" PRIu64 ", while expected: %" PRIu64 ".",
current_id, dnode->props.thin_pool_transaction_id - 1);
trans_id, dnode->props.thin_pool_transaction_id - 1);
return 0; /* Nothing to send */
}
@ -2323,7 +2322,7 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
dm_tree_set_cookie(dnode, 0);
}
if (r && !_thin_pool_node_send_messages(dnode, uuid_prefix, uuid_prefix_len)) {
if (r && !_node_send_messages(dnode, uuid_prefix, uuid_prefix_len)) {
stack;
if (!(dm_tree_deactivate_children(dnode, uuid_prefix, uuid_prefix_len)))
log_error("Failed to deactivate %s", dnode->name);