From: Jeffrey Altman Date: Tue, 3 Apr 2012 02:35:41 +0000 (-0400) Subject: viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize X-Git-Tag: upstream/1.6.2_pre2^2~194 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a64864529d1fca2b5a3f4d21ec598982be335368;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 (cherry picked from commit e8f6dfac59fe042a04a9ac5eb3c37356cb3a22a3) Reviewed-on: http://gerrit.openafs.org/7023 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 17224b935..23149763e 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -2045,8 +2045,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; @@ -5741,8 +5741,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++;