From: Jeffrey Altman Date: Tue, 3 Apr 2012 02:35:41 +0000 (-0400) Subject: viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize X-Git-Tag: upstream/1.8.0_pre1^2~2663 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e8f6dfac59fe042a04a9ac5eb3c37356cb3a22a3;p=packages%2Fo%2Fopenafs.git 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 --- 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++;