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

Add DM_CORELOG flag to dm_tree_node_add_mirror_target().

This commit is contained in:
Alasdair Kergon 2006-05-11 19:10:55 +00:00
parent 2a99b5b816
commit 9723090c92
3 changed files with 13 additions and 10 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.07 -
=============================
Add DM_CORELOG flag to dm_tree_node_add_mirror_target().
Avoid a dmeventd compiler warning.
Version 1.02.06 - 10 May 2006

View File

@ -350,6 +350,7 @@ int dm_tree_node_add_mirror_target(struct dm_tree_node *node,
#define DM_NOSYNC 0x00000001 /* Known already in sync */
#define DM_FORCESYNC 0x00000002 /* Force resync */
#define DM_BLOCK_ON_ERROR 0x00000004 /* On error, suspend I/O */
#define DM_CORELOG 0x00000008 /* In-memory log */
int dm_tree_node_add_mirror_target_log(struct dm_tree_node *node,
uint32_t region_size,

View File

@ -1243,8 +1243,8 @@ static int _emit_segment_line(struct dm_task *dmt, struct load_segment *seg, uin
log_parm_count += hweight32(seg->flags); /* [no]sync, block_on_error etc. */
if (seg->clustered) {
if (seg->uuid)
log_parm_count++; /* uuid */
if (seg->uuid && !(seg->flags & DM_CORELOG))
log_parm_count++; /* uuid (already counted for core log) */
if ((tw = _dm_snprintf(params + pos, paramsize - pos, "clustered_")) < 0) {
stack; /* Out of space */
return -1;
@ -1701,18 +1701,19 @@ int dm_tree_node_add_mirror_target_log(struct dm_tree_node *node,
seg = list_item(list_last(&node->props.segs), struct load_segment);
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);
return 0;
}
if (!_link_tree_nodes(node, log_node))
return_0;
if (!(seg->uuid = dm_pool_strdup(node->dtree->mem, log_uuid))) {
log_error("log uuid pool_strdup failed");
return 0;
}
if (!(flags & DM_CORELOG)) {
if (!(log_node = dm_tree_find_node_by_uuid(node->dtree, log_uuid))) {
log_error("Couldn't find mirror log uuid %s.", log_uuid);
return 0;
}
if (!_link_tree_nodes(node, log_node))
return_0;
}
}
seg->log = log_node;