--- libdm/.exported_symbols | 1 + libdm/libdevmapper.h | 5 +++++ libdm/libdm-deptree.c | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) Index: LVM2.2.02.45/libdm/libdevmapper.h =================================================================== --- LVM2.2.02.45.orig/libdm/libdevmapper.h 2009-05-19 14:09:42.000000000 +0200 +++ LVM2.2.02.45/libdm/libdevmapper.h 2009-05-19 14:09:45.000000000 +0200 @@ -369,6 +369,11 @@ int dm_tree_node_add_snapshot_merge_targ const char *origin_uuid, const char *cow_uuid, uint32_t chunk_size); +int dm_tree_node_add_snapshot_shared_target(struct dm_tree_node *node, + uint64_t size, + const char *origin_uuid, + const char *cow_uuid, + uint32_t chunk_size); int dm_tree_node_add_error_target(struct dm_tree_node *node, uint64_t size); int dm_tree_node_add_zero_target(struct dm_tree_node *node, Index: LVM2.2.02.45/libdm/libdm-deptree.c =================================================================== --- LVM2.2.02.45.orig/libdm/libdm-deptree.c 2009-05-19 14:09:42.000000000 +0200 +++ LVM2.2.02.45/libdm/libdm-deptree.c 2009-05-19 14:23:13.000000000 +0200 @@ -34,6 +34,7 @@ enum { SEG_SNAPSHOT, SEG_SNAPSHOT_ORIGIN, SEG_SNAPSHOT_MERGE, + SEG_SNAPSHOT_SHARED, SEG_STRIPED, SEG_ZERO, }; @@ -50,6 +51,7 @@ struct { { SEG_SNAPSHOT, "snapshot" }, { SEG_SNAPSHOT_ORIGIN, "snapshot-origin" }, { SEG_SNAPSHOT_MERGE, "snapshot-merge" }, + { SEG_SNAPSHOT_SHARED, "multisnapshot" }, { SEG_STRIPED, "striped" }, { SEG_ZERO, "zero"}, }; @@ -1323,6 +1325,14 @@ static int _emit_segment_line(struct dm_ return_0; EMIT_PARAMS(pos, "%s", originbuf); break; + case SEG_SNAPSHOT_SHARED: + if (!_build_dev_string(originbuf, sizeof(originbuf), seg->origin)) + return_0; + if (!_build_dev_string(cowbuf, sizeof(cowbuf), seg->cow)) + return_0; + EMIT_PARAMS(pos, "mikulas %s %s %d", originbuf, cowbuf, + seg->chunk_size); + break; case SEG_STRIPED: EMIT_PARAMS(pos, "%u %u", seg->area_count, seg->stripe_size); break; @@ -1333,6 +1343,7 @@ static int _emit_segment_line(struct dm_ case SEG_SNAPSHOT: case SEG_SNAPSHOT_ORIGIN: case SEG_SNAPSHOT_MERGE: + case SEG_SNAPSHOT_SHARED: case SEG_ZERO: break; case SEG_LINEAR: @@ -1653,6 +1664,16 @@ int dm_tree_node_add_snapshot_merge_targ SEG_SNAPSHOT_MERGE, 1, chunk_size); } +int dm_tree_node_add_snapshot_shared_target(struct dm_tree_node *node, + uint64_t size, + const char *origin_uuid, + const char *cow_uuid, + uint32_t chunk_size) +{ + return _add_snapshot_target(node, size, origin_uuid, cow_uuid, + SEG_SNAPSHOT_SHARED, 1, chunk_size); +} + int dm_tree_node_add_error_target(struct dm_tree_node *node, uint64_t size) { Index: LVM2.2.02.45/libdm/.exported_symbols =================================================================== --- LVM2.2.02.45.orig/libdm/.exported_symbols 2009-05-19 14:09:42.000000000 +0200 +++ LVM2.2.02.45/libdm/.exported_symbols 2009-05-19 14:09:45.000000000 +0200 @@ -63,6 +63,7 @@ dm_tree_children_use_uuid dm_tree_node_add_snapshot_origin_target dm_tree_node_add_snapshot_target dm_tree_node_add_snapshot_merge_target +dm_tree_node_add_snapshot_shared_target dm_tree_node_add_error_target dm_tree_node_add_zero_target dm_tree_node_add_linear_target