From fbe10cf294374342bb757fdd6f95e7dd7e5172f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 7 May 2007 10:45:42 +0000 Subject: [PATCH] A bit more useful output. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21052 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../bfs/mkbfs/allocationGroups.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/tests/add-ons/kernel/file_systems/bfs/mkbfs/allocationGroups.cpp b/src/tests/add-ons/kernel/file_systems/bfs/mkbfs/allocationGroups.cpp index 0d49ec0e1d..cacd9282d4 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/mkbfs/allocationGroups.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/mkbfs/allocationGroups.cpp @@ -1,7 +1,7 @@ -/* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ +/* + * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #include @@ -34,6 +34,11 @@ main(int argc, char **argv) return -1; } + int32 blockShift = 9; + while ((1UL << blockShift) < blockSize) { + blockShift++; + } + uint32 blocks_per_ag = 1; uint32 ag_shift = 13; uint32 num_ags = 0; @@ -61,12 +66,18 @@ main(int argc, char **argv) } printf("blocks = %Ld\n", numBlocks); + printf("block shift = %ld\n", blockShift); printf("bits per block = %lu\n", bitsPerBlock); printf("bitmap blocks = %Ld\n", bitmapBlocks); printf("allocation groups = %lu\n", num_ags); printf("shift = %lu (%lu)\n", ag_shift, 1UL << ag_shift); 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; }