From dc036ee5e1d054992d0a6daadc51dde35d3225a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 7 Aug 2011 15:42:21 +0000 Subject: [PATCH] * Minor simplification. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42595 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_systems/bfs/BlockAllocator.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index e4643667d4..ceb5f0dc7f 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -1324,17 +1324,14 @@ BlockAllocator::StopChecking(check_control* control) fVolume->SuperBlock().used_blocks = HOST_ENDIAN_TO_BFS_INT64(usedBlocks); - int32 blocksInBitmap = fNumGroups * fBlocksPerGroup; size_t blockSize = fVolume->BlockSize(); - if (blocksInBitmap > (int32)fNumBlocks) - blocksInBitmap = fNumBlocks; - for (int32 i = 0; i < blocksInBitmap; i += 512) { + for (uint32 i = 0; i < fNumBlocks; i += 512) { Transaction transaction(fVolume, 1 + i); - int32 blocksToWrite = 512; - if (blocksToWrite + i > blocksInBitmap) - blocksToWrite = blocksInBitmap - i; + uint32 blocksToWrite = 512; + if (blocksToWrite + i > fNumBlocks) + blocksToWrite = fNumBlocks - i; status_t status = transaction.WriteBlocks(1 + i, (uint8*)fCheckBitmap + i * blockSize, blocksToWrite);