Skip to contentSkip to conversation

LVM2/lib cache/lvmcache.c config/config.c conf ...

PATCH [email protected] 1 participant 1 message Jul 18, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mornfall at sourceware.org 2011-07-18 13:26:09

Modified files:

	lib/cache      : lvmcache.c 
	lib/config     : config.c config.h 
	lib/unknown    : unknown.c 

Log message:
Slightly refactor the config code to allow better reuse (no functional change).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.97&r2=1.98
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.h.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/unknown/unknown.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7

lib/cache/lvmcache.c +1 -2
@@ -671,8 +671,7 @@
 	/* Build config tree from vgmetadata, if not yet cached */
 	if (!vginfo->cft &&
 	    !(vginfo->cft =
-	      create_config_tree_from_string(fid->fmt->cmd,
-					     vginfo->vgmetadata)))
+	      create_config_tree_from_string(vginfo->vgmetadata)))
 		goto_bad;
 
 	if (!(vg = import_vg_from_config_tree(vginfo->cft, fid)))
lib/config/config.c +42 -7

74 lines not on this page · raw message

lib/config/config.h +10 -3
@@ -54,8 +54,8 @@
 };
 
 struct config_tree *create_config_tree(const char *filename, int keep_open);
-struct config_tree *create_config_tree_from_string(struct cmd_context *cmd,
-						   const char *config_settings);
+struct config_tree *create_config_tree_from_string(const char *config_settings);
+
 int override_config_tree_from_string(struct cmd_context *cmd,
 				     const char *config_settings);
 void destroy_config_tree(struct config_tree *cft);
@@ -120,6 +120,13 @@
 
 const char *config_parent_name(const struct config_node *n);
 
-struct config_node *clone_config_node(struct dm_pool *mem, const struct config_node *cn,
+struct config_node *clone_config_node_with_mem(struct dm_pool *mem,
+					       const struct config_node *node,
+					       int siblings);
+struct config_node *create_config_node(struct config_tree *cft, const char *key);
+struct config_node *clone_config_node(struct config_tree *cft, const struct config_node *cn,
 				      int siblings);
+
+struct dm_pool *config_tree_memory(struct config_tree *cft);
+
 #endif
lib/unknown/unknown.c +1 -1
@@ -42,7 +42,7 @@
 		if (!strcmp(current->key, "type") || !strcmp(current->key, "start_extent") ||
 		    !strcmp(current->key, "tags") || !strcmp(current->key, "extent_count"))
 			continue;
-		new = clone_config_node(seg->lv->vg->vgmem, current, 0);
+		new = clone_config_node_with_mem(seg->lv->vg->vgmem, current, 0);
 		if (!new)
 			return_0;
 		if (last)