1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Suppress move percentage when inactive

This commit is contained in:
Alasdair Kergon 2004-03-26 19:10:48 +00:00
parent 23670fbe43
commit b65b777d2a
2 changed files with 11 additions and 4 deletions

View File

@ -336,10 +336,19 @@ int lv_mirror_percent(struct logical_volume *lv, int wait, float *percent,
{ {
int r; int r;
struct dev_manager *dm; struct dev_manager *dm;
struct lvinfo info;
if (!activation()) if (!activation())
return 0; return 0;
if (!lv_info(lv, &info)) {
stack;
return 0;
}
if (!info.exists)
return 0;
if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) { if (!(dm = dev_manager_create(lv->vg->name, lv->vg->cmd->cft))) {
stack; stack;
return 0; return 0;

View File

@ -672,16 +672,14 @@ static int _movepercent_disp(struct report_handle *rh, struct field *field,
return 0; return 0;
} }
if (!(lv->status & PVMOVE)) { if (!(lv->status & PVMOVE) ||
!lv_mirror_percent(lv, 0, &move_percent, NULL)) {
field->report_string = ""; field->report_string = "";
*sortval = UINT64_C(0); *sortval = UINT64_C(0);
field->sort_value = sortval; field->sort_value = sortval;
return 1; return 1;
} }
/* Update percentage done in lv metadata in core */
lv_mirror_percent(lv, 0, &move_percent, NULL);
move_percent = pvmove_percent(lv); move_percent = pvmove_percent(lv);
if (!(repstr = pool_zalloc(rh->mem, 8))) { if (!(repstr = pool_zalloc(rh->mem, 8))) {