Added some more debug output and checks.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6355 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-01-27 11:15:43 +00:00
parent d401c62383
commit 0057030901

View File

@ -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;