From e8f6dfac59fe042a04a9ac5eb3c37356cb3a22a3 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 2 Apr 2012 22:35:41 -0400 Subject: [PATCH] viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize The AFSDisk and AFSFetchVolumeStatus structures use signed 32-bit integers for representation partition size and available blocks. RoundInt64ToInt31() should be used instead of RoundInt64ToInt32() when assigning their values. Change-Id: I3834141fce2d54ce8bdfac3dc566074583bb305e Reviewed-on: http://gerrit.openafs.org/7022 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/viced/afsfileprocs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 66a4b12a6..f75954110 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -2003,8 +2003,8 @@ RXGetVolumeStatus(AFSFetchVolumeStatus * status, char **name, char **offMsg, status->MinQuota = V_minquota(volptr); status->MaxQuota = V_maxquota(volptr); status->BlocksInUse = V_diskused(volptr); - status->PartBlocksAvail = RoundInt64ToInt32(volptr->partition->free); - status->PartMaxBlocks = RoundInt64ToInt32(volptr->partition->totalUsable); + status->PartBlocksAvail = RoundInt64ToInt31(volptr->partition->free); + status->PartMaxBlocks = RoundInt64ToInt31(volptr->partition->totalUsable); /* now allocate and copy these things; they're freed by the RXGEN stub */ temp = strlen(V_name(volptr)) + 1; @@ -4994,8 +4994,8 @@ SetVolumeStats(struct AFSStatistics *stats) for (part = DiskPartitionList; part && i < AFS_MSTATDISKS; part = part->next) { - stats->Disks[i].TotalBlocks = RoundInt64ToInt32(part->totalUsable); - stats->Disks[i].BlocksAvailable = RoundInt64ToInt32(part->free); + stats->Disks[i].TotalBlocks = RoundInt64ToInt31(part->totalUsable); + stats->Disks[i].BlocksAvailable = RoundInt64ToInt31(part->free); memset(stats->Disks[i].Name, 0, AFS_DISKNAMESIZE); strncpy(stats->Disks[i].Name, part->name, AFS_DISKNAMESIZE); i++; -- 2.39.5