1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o vg->pv_act

This commit is contained in:
Joe Thornber 2001-10-11 13:05:55 +00:00
parent ab47fb661f
commit ece1fe835c
3 changed files with 24 additions and 2 deletions

View File

@ -218,5 +218,6 @@ int export_uuids(struct disk_list *dl, struct volume_group *vg);
void export_numbers(struct list_head *pvs, struct volume_group *vg);
void export_pv_act(struct list_head *pvs);
#endif

View File

@ -151,6 +151,8 @@ static int _flatten_vg(struct pool *mem, struct volume_group *vg,
}
export_numbers(pvs, vg);
export_pv_act(pvs);
return 1;
}

View File

@ -231,8 +231,6 @@ int export_vg(struct vg_disk *vgd, struct volume_group *vg)
vgd->pv_max = vg->max_pv;
vgd->pv_cur = vg->pv_count;
//vgd->pv_act = ???;
vgd->pe_size = vg->extent_size;
vgd->pe_total = vg->extent_count;
vgd->pe_allocated = vg->extent_count - vg->free_count;
@ -566,3 +564,24 @@ void export_numbers(struct list_head *pvs, struct volume_group *vg)
}
}
}
/*
* Calculate vg_disk->pv_act.
*/
void export_pv_act(struct list_head *pvs)
{
struct list_head *tmp;
struct disk_list *dl;
int act = 0;
list_for_each (tmp, pvs) {
dl = list_entry(tmp, struct disk_list, list);
if (dl->pv.pv_status & PV_ACTIVE)
act++;
}
list_for_each (tmp, pvs) {
dl = list_entry(tmp, struct disk_list, list);
dl->vg.pv_act = act;
}
}