summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2008-01-17 13:54:05 +0000
committerAlasdair Kergon <agk@redhat.com>2008-01-17 13:54:05 +0000
commitdb24ceca33665da195434804eb9ff11155bee4b6 (patch)
tree3c0d862cad6cb3bacfaa920b68d2d6a021a4faef
parent58a63ae973da6add5421ed192f3270b2fe54d3ff (diff)
downloadlvm2-db24ceca33665da195434804eb9ff11155bee4b6.tar.gz
lvm2-db24ceca33665da195434804eb9ff11155bee4b6.tar.xz
lvm2-db24ceca33665da195434804eb9ff11155bee4b6.zip
rename lv_remap_error
-rw-r--r--lib/metadata/lv_manip.c2
-rw-r--r--lib/metadata/metadata-exported.h2
-rw-r--r--lib/metadata/mirror.c4
-rw-r--r--tools/vgreduce.c18
4 files changed, 8 insertions, 18 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 5f7caf80..1d52f4ae 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -461,7 +461,7 @@ int lv_empty(struct logical_volume *lv)
/*
* Empty an LV and add error segment.
*/
-int lv_remap_error(struct logical_volume *lv)
+int replace_lv_with_error_segment(struct logical_volume *lv)
{
uint32_t len = lv->le_count;
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
index 817b6f17..626bc1e8 100644
--- a/lib/metadata/metadata-exported.h
+++ b/lib/metadata/metadata-exported.h
@@ -379,7 +379,7 @@ int lv_reduce(struct logical_volume *lv, uint32_t extents);
int lv_empty(struct logical_volume *lv);
/* Empty an LV and add error segment */
-int lv_remap_error(struct logical_volume *lv);
+int replace_lv_with_error_segment(struct logical_volume *lv);
/* Entry point for all LV extent allocations */
int lv_extend(struct logical_volume *lv,
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index 2e58f213..f0397139 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -521,7 +521,7 @@ static int _remove_mirror_images(struct logical_volume *lv,
_remove_mirror_log(mirrored_seg);
lv->status &= ~MIRRORED;
lv->status &= ~MIRROR_NOTSYNCED;
- if (!lv_remap_error(lv))
+ if (!replace_lv_with_error_segment(lv))
return_0;
remove_log = 1;
} else if (remove_log)
@@ -616,7 +616,7 @@ int remove_mirror_images(struct logical_volume *lv, uint32_t num_mirrors,
/* Some mirrors are removed from the temporary mirror,
* but the temporary layer still exists.
* Down the stack and retry for remainder. */
- next_lv = find_tmp_mirror(next_lv);
+ next_lv = find_temporary_mirror(next_lv);
}
num_removed -= r;
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index caf93b68..0f893171 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -54,7 +54,6 @@ static int _remove_lv(struct cmd_context *cmd, struct logical_volume *lv,
struct list *snh, *snht;
struct logical_volume *cow;
struct lv_list *lvl;
- uint32_t extents;
struct lvinfo info;
int first = 1;
@@ -116,19 +115,10 @@ static int _remove_lv(struct cmd_context *cmd, struct logical_volume *lv,
* the mirrored LV also should be cleaned up.
* Clean-up is currently done by caller (_make_vg_consistent()).
*/
- if ((lv_info(cmd, lv, &info, 0, 0) && info.exists)
- || find_mirror_seg(first_seg(lv))) {
- extents = lv->le_count;
- if (!lv_empty(lv)) {
- stack;
- return 0;
- }
- if (!lv_add_virtual_segment(lv, 0, extents,
- get_segtype_from_string(cmd,
- "error"))) {
- stack;
- return 0;
- }
+ if ((lv_info(cmd, lv, &info, 0, 0) && info.exists) ||
+ find_mirror_seg(first_seg(lv))) {
+ if (!replace_lv_with_error_segment(lv))
+ return_0;
if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
log_error("lv_list alloc failed");