mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Convert pv->pe_alloc_count to get_pv_pe_alloc_count
This commit is contained in:
parent
fb6ca78e05
commit
aeea47205b
@ -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);
|
||||
if (*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->pe_alloc_count = 0;
|
||||
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)
|
||||
size = pv->size;
|
||||
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)) {
|
||||
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 : " ",
|
||||
display_size(cmd, (uint64_t) pv->pe_count * pv->pe_size),
|
||||
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));
|
||||
return;
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg,
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
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_to->extent_count += pv->pe_count;
|
||||
|
||||
vg_from->free_count -= pv->pe_count - pv->pe_alloc_count;
|
||||
vg_to->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 - get_pv_pe_alloc_count(pv);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user