summaryrefslogtreecommitdiffstats
path: root/tools/vgreduce.c
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 /tools/vgreduce.c
parent58a63ae973da6add5421ed192f3270b2fe54d3ff (diff)
downloadlvm2-db24ceca33665da195434804eb9ff11155bee4b6.tar.gz
lvm2-db24ceca33665da195434804eb9ff11155bee4b6.tar.xz
lvm2-db24ceca33665da195434804eb9ff11155bee4b6.zip
rename lv_remap_error
Diffstat (limited to 'tools/vgreduce.c')
-rw-r--r--tools/vgreduce.c18
1 files changed, 4 insertions, 14 deletions
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");