From 274c88be9f94933f12435ea2e0ab815b353ad59d Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 1 Feb 2005 16:19:48 +0000 Subject: [PATCH] More 64-bit display/report fixes. --- WHATS_NEW | 1 + lib/display/display.c | 2 +- lib/report/report.c | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index ae6308556..353af76fa 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.01.03 - =================================== + More 64-bit display/report fixes. More informative startup mesg if can't create /etc/lvm. Fix snapshot device size bug (since 2.01.01). clvmd announces startup and cluster connection in syslog. diff --git a/lib/display/display.c b/lib/display/display.c index 14605ed27..3be412cc6 100644 --- a/lib/display/display.c +++ b/lib/display/display.c @@ -258,7 +258,7 @@ void pvdisplay_full(struct cmd_context *cmd, struct physical_volume *pv, log_print("PV Size %s" " / not usable %s", /* [LVM: %s]", */ size, display_size(cmd, (pv->size - - pv->pe_count * pv->pe_size), + (uint64_t) pv->pe_count * pv->pe_size), SIZE_SHORT)); } else diff --git a/lib/report/report.c b/lib/report/report.c index 46b288eb8..6b6666675 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -573,7 +573,7 @@ static int _vgsize_disp(struct report_handle *rh, struct field *field, const struct volume_group *vg = (const struct volume_group *) data; uint64_t size; - size = vg->extent_count * vg->extent_size; + size = (uint64_t) vg->extent_count * vg->extent_size; return _size64_disp(rh, field, &size); } @@ -584,7 +584,7 @@ static int _segstart_disp(struct report_handle *rh, struct field *field, const struct lv_segment *seg = (const struct lv_segment *) data; uint64_t start; - start = seg->le * seg->lv->vg->extent_size; + start = (uint64_t) seg->le * seg->lv->vg->extent_size; return _size64_disp(rh, field, &start); } @@ -595,7 +595,7 @@ static int _segsize_disp(struct report_handle *rh, struct field *field, const struct lv_segment *seg = (const struct lv_segment *) data; uint64_t size; - size = seg->len * seg->lv->vg->extent_size; + size = (uint64_t) seg->len * seg->lv->vg->extent_size; return _size64_disp(rh, field, &size); } @@ -610,7 +610,7 @@ static int _pvused_disp(struct report_handle *rh, struct field *field, if (!pv->pe_count) used = 0LL; else - used = pv->pe_alloc_count * pv->pe_size; + used = (uint64_t) pv->pe_alloc_count * pv->pe_size; return _size64_disp(rh, field, &used); } @@ -625,7 +625,7 @@ static int _pvfree_disp(struct report_handle *rh, struct field *field, if (!pv->pe_count) freespace = pv->size; else - freespace = (pv->pe_count - pv->pe_alloc_count) * pv->pe_size; + freespace = (uint64_t) (pv->pe_count - pv->pe_alloc_count) * pv->pe_size; return _size64_disp(rh, field, &freespace); } @@ -640,7 +640,7 @@ static int _pvsize_disp(struct report_handle *rh, struct field *field, if (!pv->pe_count) size = pv->size; else - size = pv->pe_count * pv->pe_size; + size = (uint64_t) pv->pe_count * pv->pe_size; return _size64_disp(rh, field, &size); } @@ -663,7 +663,7 @@ static int _vgfree_disp(struct report_handle *rh, struct field *field, const struct volume_group *vg = (const struct volume_group *) data; uint64_t freespace; - freespace = vg->free_count * vg->extent_size; + freespace = (uint64_t) vg->free_count * vg->extent_size; return _size64_disp(rh, field, &freespace); }