A bit more useful output.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21052 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-05-07 10:45:42 +00:00
parent 44d1fa37cd
commit fbe10cf294
@@ -1,6 +1,6 @@
/* /*
** Copyright 2004, Axel Dörfler, [email protected]. All rights reserved. * Copyright 2004-2007, Axel Dörfler, [email protected]. All rights reserved.
** Distributed under the terms of the OpenBeOS License. * Distributed under the terms of the MIT License.
*/ */
@@ -34,6 +34,11 @@ main(int argc, char **argv)
return -1; return -1;
} }
int32 blockShift = 9;
while ((1UL << blockShift) < blockSize) {
blockShift++;
}
uint32 blocks_per_ag = 1; uint32 blocks_per_ag = 1;
uint32 ag_shift = 13; uint32 ag_shift = 13;
uint32 num_ags = 0; uint32 num_ags = 0;
@@ -61,12 +66,18 @@ main(int argc, char **argv)
} }
printf("blocks = %Ld\n", numBlocks); printf("blocks = %Ld\n", numBlocks);
printf("block shift = %ld\n", blockShift);
printf("bits per block = %lu\n", bitsPerBlock); printf("bits per block = %lu\n", bitsPerBlock);
printf("bitmap blocks = %Ld\n", bitmapBlocks); printf("bitmap blocks = %Ld\n", bitmapBlocks);
printf("allocation groups = %lu\n", num_ags); printf("allocation groups = %lu\n", num_ags);
printf("shift = %lu (%lu)\n", ag_shift, 1UL << ag_shift); printf("shift = %lu (%lu)\n", ag_shift, 1UL << ag_shift);
printf("blocks per group = %lu\n", blocks_per_ag); printf("blocks per group = %lu\n", blocks_per_ag);
uint32 bitsPerGroup = 8 * (blocks_per_ag << blockShift);
printf("\nBits per group: %ld\n", bitsPerGroup);
printf("Bits in last group: %ld\n", numBlocks - (num_ags - 1) * bitsPerGroup);
return 0; return 0;
} }