mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-04 12:22:00 +03:00
Convert pv->pe_alloc_count to get_pv_pe_alloc_count
This commit is contained in:
@ -182,7 +182,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
|
|||||||
log_verbose("Changing uuid of %s to %s.", pv_name, uuid);
|
log_verbose("Changing uuid of %s to %s.", pv_name, uuid);
|
||||||
if (*pv->vg_name) {
|
if (*pv->vg_name) {
|
||||||
orig_vg_name = pv->vg_name;
|
orig_vg_name = pv->vg_name;
|
||||||
orig_pe_alloc_count = pv->pe_alloc_count;
|
orig_pe_alloc_count = get_pv_pe_alloc_count(pv);
|
||||||
pv->vg_name = ORPHAN;
|
pv->vg_name = ORPHAN;
|
||||||
pv->pe_alloc_count = 0;
|
pv->pe_alloc_count = 0;
|
||||||
if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) {
|
if (!(pv_write(cmd, pv, NULL, INT64_C(-1)))) {
|
||||||
|
@ -59,7 +59,7 @@ static int _pvdisplay_single(struct cmd_context *cmd,
|
|||||||
if (!*pv->vg_name)
|
if (!*pv->vg_name)
|
||||||
size = pv->size;
|
size = pv->size;
|
||||||
else
|
else
|
||||||
size = (pv->pe_count - pv->pe_alloc_count) * pv->pe_size;
|
size = (pv->pe_count - get_pv_pe_alloc_count(pv)) * pv->pe_size;
|
||||||
|
|
||||||
if (arg_count(cmd, short_ARG)) {
|
if (arg_count(cmd, short_ARG)) {
|
||||||
log_print("Device \"%s\" has a capacity of %s", pv_name,
|
log_print("Device \"%s\" has a capacity of %s", pv_name,
|
||||||
|
@ -91,7 +91,7 @@ static void _pvscan_display_single(struct cmd_context *cmd,
|
|||||||
pv->fmt ? pv->fmt->name : " ",
|
pv->fmt ? pv->fmt->name : " ",
|
||||||
display_size(cmd, (uint64_t) pv->pe_count * pv->pe_size),
|
display_size(cmd, (uint64_t) pv->pe_count * pv->pe_size),
|
||||||
display_size(cmd,
|
display_size(cmd,
|
||||||
(uint64_t) (pv->pe_count - pv->pe_alloc_count) *
|
(uint64_t) (pv->pe_count - get_pv_pe_alloc_count(pv)) *
|
||||||
pv->pe_size));
|
pv->pe_size));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
vg->pv_count--;
|
vg->pv_count--;
|
||||||
vg->free_count -= pv->pe_count - pv->pe_alloc_count;
|
vg->free_count -= pv->pe_count - get_pv_pe_alloc_count(pv);
|
||||||
vg->extent_count -= pv->pe_count;
|
vg->extent_count -= pv->pe_count;
|
||||||
|
|
||||||
if (!vg_write(vg) || !vg_commit(vg)) {
|
if (!vg_write(vg) || !vg_commit(vg)) {
|
||||||
|
@ -38,8 +38,8 @@ static int _move_pv(struct volume_group *vg_from, struct volume_group *vg_to,
|
|||||||
vg_from->extent_count -= pv->pe_count;
|
vg_from->extent_count -= pv->pe_count;
|
||||||
vg_to->extent_count += pv->pe_count;
|
vg_to->extent_count += pv->pe_count;
|
||||||
|
|
||||||
vg_from->free_count -= pv->pe_count - pv->pe_alloc_count;
|
vg_from->free_count -= pv->pe_count - get_pv_pe_alloc_count(pv);
|
||||||
vg_to->free_count += pv->pe_count - pv->pe_alloc_count;
|
vg_to->free_count += pv->pe_count - get_pv_pe_alloc_count(pv);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user