* Fixed two bugs in CheckBlocks(), might help with bug #4042.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31252 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-06-26 13:47:13 +00:00
parent 125e089e1a
commit 2dbad0651e
@@ -1514,7 +1514,7 @@ BlockAllocator::CheckBlocks(off_t start, off_t length, bool allocated)
return B_BAD_VALUE;
uint32 group = start >> fVolume->AllocationGroupShift();
uint32 groupBlock = start % (fVolume->BlockSize() << 3);
uint32 groupBlock = start / (fVolume->BlockSize() << 3);
uint32 blockOffset = start % fVolume->BlockSize();
AllocationBlock cached(fVolume);
@@ -1530,6 +1530,8 @@ BlockAllocator::CheckBlocks(off_t start, off_t length, bool allocated)
}
}
blockOffset = 0;
if (++groupBlock >= fGroups[group].NumBlocks()) {
groupBlock = 0;
group++;