Skip to contentSkip to conversation

master - activation: simplify activation code

PATCH Zdenek Kabelac 1 participant 1 message Feb 23, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3679bb1cd9f48a0dc4a557ad1c3c3b3713e840bf
Commit:        3679bb1cd9f48a0dc4a557ad1c3c3b3713e840bf
Parent:        0631d233d84cc451380155b8062bd37c6f22c2f7
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Feb 21 10:39:47 2013 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sat Feb 23 10:30:03 2013 +0100

activation: simplify activation code

Reorder activation code to look similar for preload tree and activation tree.

Its also give much better suppport for device stacking, since now we also support activation of snapshot which might be then used for other devices.

---
 WHATS_NEW                  |    1 +
 lib/activate/activate.h    |    1 -
 lib/activate/dev_manager.c |  249 +++++++++++++++++++++-----------------------
 lib/thin/thin.c            |   15 ---
 4 files changed, 121 insertions(+), 145 deletions(-)
WHATS_NEW +1 -0
index 68baaf1..273f152 100644
@@ -1,5 +1,6 @@
 Version 2.02.99 - 
 ===================================
+  Improve activation code for better support of stacked devices.
   Add _add_layer_target_to_dtree() for adding linear layer into dtree.
   Extend _cached_info() to accept layer string.
   Allow identical table reload for RAID to restore transiently failed PVs.
lib/activate/activate.h +0 -1
index df4120c..bf1f7a0 100644
@@ -34,7 +34,6 @@ struct lv_activate_opts {
 	int exclusive;
 	int origin_only;
 	int no_merging;
-	int real_pool;
 	int send_messages;
 	int skip_in_use;
 	unsigned revert;
lib/activate/dev_manager.c +120 -129

331 lines not on this page · raw message

lib/thin/thin.c +0 -15
index 06ab67b..4b9bb8b 100644
@@ -251,21 +251,6 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
 		return 0;
 	}
 
-	if (!laopts->real_pool) {
-		if (!(pool_dlid = build_dm_uuid(mem, seg->lv->lvid.s, "tpool"))) {
-			log_error("Failed to build uuid for thin pool LV %s.", seg->pool_lv->name);
-			return 0;
-		}
-
-		if (!add_linear_area_to_dtree(node, len, seg->lv->vg->extent_size,
-					      cmd->use_linear_target,
-					      seg->lv->vg->name, seg->lv->name) ||
-		    !dm_tree_node_add_target_area(node, NULL, pool_dlid, 0))
-			return_0;
-
-		return 1;
-	}
-
 	if (!(metadata_dlid = build_dm_uuid(mem, seg->metadata_lv->lvid.s, NULL))) {
 		log_error("Failed to build uuid for metadata LV %s.",
 			  seg->metadata_lv->name);