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 <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Jeffrey Altman 2012-04-02 22:35:41 -04:00 committed by Derrick Brashear
parent 223cbf5a5b
commit e8f6dfac59

View File

@ -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++;