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:
@@ -480,6 +480,8 @@ BlockAllocator::AllocateBlocks(Transaction *transaction, int32 group, uint16 sta
|
|||||||
if (maximum == 0)
|
if (maximum == 0)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
FUNCTION_START(("group = %ld, start = %u, maximum = %u, minimum = %u\n", group, start, maximum, minimum));
|
||||||
|
|
||||||
AllocationBlock cached(fVolume);
|
AllocationBlock cached(fVolume);
|
||||||
Locker lock(fLock);
|
Locker lock(fLock);
|
||||||
|
|
||||||
@@ -660,6 +662,8 @@ BlockAllocator::Free(Transaction *transaction, block_run run)
|
|||||||
uint16 start = run.Start();
|
uint16 start = run.Start();
|
||||||
uint16 length = run.Length();
|
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
|
// doesn't use Volume::IsValidBlockRun() here because it can check better
|
||||||
// against the group size (the last group may have a different length)
|
// against the group size (the last group may have a different length)
|
||||||
if (group < 0 || group >= fNumGroups
|
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)
|
if (fGroups[group].Free(transaction, start, length) < B_OK)
|
||||||
RETURN_ERROR(B_IO_ERROR);
|
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 =
|
fVolume->SuperBlock().used_blocks =
|
||||||
HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() - run.Length());
|
HOST_ENDIAN_TO_BFS_INT64(fVolume->UsedBlocks() - run.Length());
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user