From: Jeffrey Altman Date: Fri, 25 Jan 2013 05:18:37 +0000 (-0500) Subject: Windows: .readonly space reporting X-Git-Tag: upstream/1.8.0_pre1^2~1587 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ed6354881d6f55ced842e3e78a02133fba8823ae;p=packages%2Fo%2Fopenafs.git Windows: .readonly space reporting .readonly volumes can be stored on multiple partitions which each have a different size and free space available. To ensure consistency regardless of which partition the .readonly is accessed from and because .readonly volume sizes cannot change, report the allocation size of the volume as the partition size. Continue to report that volume has zero free sectors because the volume cannot be written to. Change-Id: Ib57b1175da048344af615b9350d72d9eb3ffe97d Reviewed-on: http://gerrit.openafs.org/8976 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index 29e192851..dce0be564 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -5460,26 +5460,19 @@ RDR_GetVolumeInfo( IN cm_user_t *userp, } if (code == 0) { - if (volStat.MaxQuota) - { - pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota; - if (volType == ROVOL || volType == BACKVOL) { - pResultCB->AvailableAllocationUnits.QuadPart = 0; - } - else + if (volType == ROVOL || volType == BACKVOL) { + pResultCB->TotalAllocationUnits.QuadPart = volStat.BlocksInUse; + pResultCB->AvailableAllocationUnits.QuadPart = 0; + } else { + if (volStat.MaxQuota) { + pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota; pResultCB->AvailableAllocationUnits.QuadPart = min(volStat.MaxQuota - volStat.BlocksInUse, volStat.PartBlocksAvail); } - } - else - { - pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks; - if (volType == ROVOL || volType == BACKVOL) { - pResultCB->AvailableAllocationUnits.QuadPart = 0; - } else { + pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks; pResultCB->AvailableAllocationUnits.QuadPart = volStat.PartBlocksAvail; } } @@ -5636,26 +5629,19 @@ RDR_GetVolumeSizeInfo( IN cm_user_t *userp, } if (code == 0) { - if (volStat.MaxQuota) - { - pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota; - if (volType == ROVOL || volType == BACKVOL) { - pResultCB->AvailableAllocationUnits.QuadPart = 0; - } - else + if (volType == ROVOL || volType == BACKVOL) { + pResultCB->TotalAllocationUnits.QuadPart = volStat.BlocksInUse; + pResultCB->AvailableAllocationUnits.QuadPart = 0; + } else { + if (volStat.MaxQuota) { + pResultCB->TotalAllocationUnits.QuadPart = volStat.MaxQuota; pResultCB->AvailableAllocationUnits.QuadPart = min(volStat.MaxQuota - volStat.BlocksInUse, volStat.PartBlocksAvail); } - } - else - { - pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks; - if (volType == ROVOL || volType == BACKVOL) { - pResultCB->AvailableAllocationUnits.QuadPart = 0; - } else { + pResultCB->TotalAllocationUnits.QuadPart = volStat.PartMaxBlocks; pResultCB->AvailableAllocationUnits.QuadPart = volStat.PartBlocksAvail; } }