From 0057030901fcbb2703e2f818c71ba314c1a873a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 27 Jan 2004 11:15:43 +0000 Subject: [PATCH] Added some more debug output and checks. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6355 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index 799d6235e8..ff33211b94 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -480,6 +480,8 @@ BlockAllocator::AllocateBlocks(Transaction *transaction, int32 group, uint16 sta if (maximum == 0) return B_BAD_VALUE; + FUNCTION_START(("group = %ld, start = %u, maximum = %u, minimum = %u\n", group, start, maximum, minimum)); + AllocationBlock cached(fVolume); Locker lock(fLock); @@ -660,6 +662,8 @@ BlockAllocator::Free(Transaction *transaction, block_run run) uint16 start = run.Start(); uint16 length = run.Length(); + FUNCTION_START(("group = %ld, start = %u, length = %u\n", group, start, length)); + // doesn't use Volume::IsValidBlockRun() here because it can check better // against the group size (the last group may have a different length) if (group < 0 || group >= fNumGroups @@ -684,6 +688,11 @@ BlockAllocator::Free(Transaction *transaction, block_run run) if (fGroups[group].Free(transaction, start, length) < B_OK) RETURN_ERROR(B_IO_ERROR); +#ifdef DEBUG + if (CheckBlockRun(run) == B_OK) + DEBUGGER(("CheckBlockRun() reports allocated blocks (which were just freed)\n")); +#endif + fVolume->SuperBlock().used_blocks = HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() - run.Length()); return B_OK;