Use a string instead of an integer to specify the exception store type. It will be used for shared snapshots. Signed-off-by: Mikulas Patocka --- lib/activate/dev_manager.c | 2 +- libdm/libdevmapper.h | 2 +- libdm/libdm-deptree.c | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) Index: LVM2.2.02.53/lib/activate/dev_manager.c =================================================================== --- LVM2.2.02.53.orig/lib/activate/dev_manager.c 2009-10-12 13:50:18.000000000 +0200 +++ LVM2.2.02.53/lib/activate/dev_manager.c 2009-10-12 13:50:30.000000000 +0200 @@ -869,7 +869,7 @@ static int _add_snapshot_target_to_dtree size = (uint64_t) snap_seg->len * snap_seg->origin->vg->extent_size; - if (!dm_tree_node_add_snapshot_target(dnode, size, origin_dlid, cow_dlid, 1, snap_seg->chunk_size)) + if (!dm_tree_node_add_snapshot_target(dnode, size, origin_dlid, cow_dlid, "P", snap_seg->chunk_size)) return_0; return 1; Index: LVM2.2.02.53/libdm/libdm-deptree.c =================================================================== --- LVM2.2.02.53.orig/libdm/libdm-deptree.c 2009-10-12 13:50:58.000000000 +0200 +++ LVM2.2.02.53/libdm/libdm-deptree.c 2009-10-12 13:53:24.000000000 +0200 @@ -77,7 +77,7 @@ struct load_segment { uint32_t stripe_size; /* Striped */ - int persistent; /* Snapshot */ + const char *exception_store; /* Snapshot */ uint32_t chunk_size; /* Snapshot */ struct dm_tree_node *cow; /* Snapshot */ struct dm_tree_node *origin; /* Snapshot + Snapshot origin */ @@ -1429,8 +1429,8 @@ static int _emit_segment_line(struct dm_ return_0; if (!_build_dev_string(cowbuf, sizeof(cowbuf), seg->cow)) return_0; - EMIT_PARAMS(pos, "%s %s %c %d", originbuf, cowbuf, - seg->persistent ? 'P' : 'N', seg->chunk_size); + EMIT_PARAMS(pos, "%s %s %s %d", originbuf, cowbuf, + seg->exception_store, seg->chunk_size); break; case SEG_SNAPSHOT_ORIGIN: if (!_build_dev_string(originbuf, sizeof(originbuf), seg->origin)) @@ -1682,7 +1682,7 @@ static struct load_segment *_add_segment seg->area_count = 0; dm_list_init(&seg->areas); seg->stripe_size = 0; - seg->persistent = 0; + seg->exception_store = NULL; seg->chunk_size = 0; seg->cow = NULL; seg->origin = NULL; @@ -1722,7 +1722,7 @@ int dm_tree_node_add_snapshot_target(str uint64_t size, const char *origin_uuid, const char *cow_uuid, - int persistent, + const char *exception_store, uint32_t chunk_size) { struct load_segment *seg; @@ -1749,7 +1749,11 @@ int dm_tree_node_add_snapshot_target(str if (!_link_tree_nodes(node, cow_node)) return_0; - seg->persistent = persistent ? 1 : 0; + seg->exception_store = dm_pool_strdup(node->dtree->mem, exception_store); + if (!seg->exception_store) { + log_error("exception_store allocation failed"); + return_0; + } seg->chunk_size = chunk_size; return 1; Index: LVM2.2.02.53/libdm/libdevmapper.h =================================================================== --- LVM2.2.02.53.orig/libdm/libdevmapper.h 2009-10-12 13:49:33.000000000 +0200 +++ LVM2.2.02.53/libdm/libdevmapper.h 2009-10-12 14:09:31.000000000 +0200 @@ -380,7 +380,7 @@ int dm_tree_node_add_snapshot_target(str uint64_t size, const char *origin_uuid, const char *cow_uuid, - int persistent, + const char *exception_store, uint32_t chunk_size); int dm_tree_node_add_error_target(struct dm_tree_node *node, uint64_t size);