summaryrefslogtreecommitdiff
path: root/lib/mirror
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2011-08-30 14:55:15 +0000
committerPetr Rockai <prockai@redhat.com>2011-08-30 14:55:15 +0000
commite59e2f7c3c1e2fa170dfca2ee0c29cca2d4f55c1 (patch)
tree197a579049ddab74d8944939a45f8e0d46b6c3cf /lib/mirror
parentd35188058be01bd29128dcf1f5b79220fbcb135b (diff)
downloadlvm2-e59e2f7c3c1e2fa170dfca2ee0c29cca2d4f55c1.tar.gz
Move the core of the lib/config/config.c functionality into libdevmapper,
leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
Diffstat (limited to 'lib/mirror')
-rw-r--r--lib/mirror/mirrored.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c
index 49b39e74c..96fa92776 100644
--- a/lib/mirror/mirrored.c
+++ b/lib/mirror/mirrored.c
@@ -69,46 +69,46 @@ static void _mirrored_display(const struct lv_segment *seg)
log_print(" ");
}
-static int _mirrored_text_import_area_count(const struct config_node *sn, uint32_t *area_count)
+static int _mirrored_text_import_area_count(const struct dm_config_node *sn, uint32_t *area_count)
{
- if (!get_config_uint32(sn, "mirror_count", area_count)) {
+ if (!dm_config_get_uint32(sn, "mirror_count", area_count)) {
log_error("Couldn't read 'mirror_count' for "
- "segment '%s'.", config_parent_name(sn));
+ "segment '%s'.", dm_config_parent_name(sn));
return 0;
}
return 1;
}
-static int _mirrored_text_import(struct lv_segment *seg, const struct config_node *sn,
+static int _mirrored_text_import(struct lv_segment *seg, const struct dm_config_node *sn,
struct dm_hash_table *pv_hash)
{
- const struct config_node *cn;
+ const struct dm_config_node *cn;
const char *logname = NULL;
- if (find_config_node(sn, "extents_moved")) {
- if (get_config_uint32(sn, "extents_moved",
+ if (dm_config_find_node(sn, "extents_moved")) {
+ if (dm_config_get_uint32(sn, "extents_moved",
&seg->extents_copied))
seg->status |= PVMOVE;
else {
log_error("Couldn't read 'extents_moved' for "
"segment %s of logical volume %s.",
- config_parent_name(sn), seg->lv->name);
+ dm_config_parent_name(sn), seg->lv->name);
return 0;
}
}
- if (find_config_node(sn, "region_size")) {
- if (!get_config_uint32(sn, "region_size",
+ if (dm_config_find_node(sn, "region_size")) {
+ if (!dm_config_get_uint32(sn, "region_size",
&seg->region_size)) {
log_error("Couldn't read 'region_size' for "
"segment %s of logical volume %s.",
- config_parent_name(sn), seg->lv->name);
+ dm_config_parent_name(sn), seg->lv->name);
return 0;
}
}
- if ((cn = find_config_node(sn, "mirror_log"))) {
+ if ((cn = dm_config_find_node(sn, "mirror_log"))) {
if (!cn->v || !cn->v->v.str) {
log_error("Mirror log type must be a string.");
return 0;
@@ -117,7 +117,7 @@ static int _mirrored_text_import(struct lv_segment *seg, const struct config_nod
if (!(seg->log_lv = find_lv(seg->lv->vg, logname))) {
log_error("Unrecognised mirror log in "
"segment %s of logical volume %s.",
- config_parent_name(sn), seg->lv->name);
+ dm_config_parent_name(sn), seg->lv->name);
return 0;
}
seg->log_lv->status |= MIRROR_LOG;
@@ -126,14 +126,14 @@ static int _mirrored_text_import(struct lv_segment *seg, const struct config_nod
if (logname && !seg->region_size) {
log_error("Missing region size for mirror log for "
"segment %s of logical volume %s.",
- config_parent_name(sn), seg->lv->name);
+ dm_config_parent_name(sn), seg->lv->name);
return 0;
}
- if (!(cn = find_config_node(sn, "mirrors"))) {
+ if (!(cn = dm_config_find_node(sn, "mirrors"))) {
log_error("Couldn't find mirrors array for "
"segment %s of logical volume %s.",
- config_parent_name(sn), seg->lv->name);
+ dm_config_parent_name(sn), seg->lv->name);
return 0;
}