[haiku-commits] r42595 - haiku/trunk/src/add-ons/kernel/file_systems/bfs

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 7 Aug 2011 17:42:21 +0200 (CEST)

Author: axeld
Date: 2011-08-07 17:42:21 +0200 (Sun, 07 Aug 2011)
New Revision: 42595
Changeset: https://dev.haiku-os.org/changeset/42595

Modified:
   haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
Log:
* Minor simplification.


Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp  
2011-08-07 14:53:10 UTC (rev 42594)
+++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp  
2011-08-07 15:42:21 UTC (rev 42595)
@@ -1324,17 +1324,14 @@
                        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);


Other related posts:

  • » [haiku-commits] r42595 - haiku/trunk/src/add-ons/kernel/file_systems/bfs - axeld