Merge "Correct reserved blocks to segments" into main am: ab2b49bb74 am: 4922ef2616 am: b8db678950

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2736813

Change-Id: I07bcec0f59c9889564f0d38acd293e9c46858173
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Daeho Jeong 2023-09-01 01:35:48 +00:00 committed by Automerger Merge Worker
commit 10987fcfd8

View file

@ -551,9 +551,9 @@ void SetGCUrgentPace(int32_t neededSegments, int32_t minSegmentThreshold, float
int32_t freeSegments = std::stoi(freeSegmentsStr);
int32_t dirtySegments = std::stoi(dirtySegmentsStr);
int32_t reservedBlocks = std::stoi(ovpSegmentsStr) + std::stoi(reservedBlocksStr);
int32_t reservedSegments = std::stoi(ovpSegmentsStr) + std::stoi(reservedBlocksStr) / 512;
freeSegments = freeSegments > reservedBlocks ? freeSegments - reservedBlocks : 0;
freeSegments = freeSegments > reservedSegments ? freeSegments - reservedSegments : 0;
int32_t totalSegments = freeSegments + dirtySegments;
int32_t finalTargetSegments = 0;