From b06a5d91f921a811d4a2dfc19c5ed56a19b48475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 15 Oct 2008 01:21:31 +0000 Subject: [PATCH] * Fixed a bad bug (that I introduced with one of the last commits...) that could check memory beyond the block and then tried to allocate that on the correct block (would possibly lead to KDL). * Made AllocationBlock::Allocate() and Free() inline. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28117 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp index f3211042e3..cadb2e5ead 100644 --- a/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp @@ -154,8 +154,8 @@ class AllocationBlock : public CachedBlock { public: AllocationBlock(Volume* volume); - void Allocate(uint16 start, uint16 numBlocks); - void Free(uint16 start, uint16 numBlocks); + inline void Allocate(uint16 start, uint16 numBlocks); + inline void Free(uint16 start, uint16 numBlocks); inline bool IsUsed(uint16 block); status_t SetTo(AllocationGroup& group, uint16 block); @@ -755,7 +755,7 @@ BlockAllocator::AllocateBlocks(Transaction& transaction, int32 group, int32 range = 0, rangeStart = 0; int32 groupLargestStart = -1; int32 groupLargest = -1; - int32 current = block * bitsPerFullBlock + start; + int32 current = start; bool canUseLargest = start == 0; for (; block < fGroups[group].NumBlocks(); block++) {