1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

rename lv_remap_error

This commit is contained in:
Alasdair Kergon 2008-01-17 13:54:05 +00:00
parent 58a63ae973
commit db24ceca33
4 changed files with 8 additions and 18 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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");