From ed6354881d6f55ced842e3e78a02133fba8823ae Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 25 Jan 2013 00:18:37 -0500 Subject: [PATCH] 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 --- src/WINNT/afsrdr/user/RDRFunction.c | 42 ++++++++++------------------- 1 file changed, 14 insertions(+), 28 deletions(-) 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; } } -- 2.39.5