2 * Copyright 2001-2010, Haiku Inc. All rights reserved.
3 * This file may be used under the terms of the MIT License.
6 * Janito V. Ferreira Filho
8 #ifndef BLOCKALLOCATOR_H
9 #define BLOCKALLOCATOR_H
15 #include "Transaction.h"
18 class AllocationBlockGroup
;
23 class BlockAllocator
{
25 BlockAllocator(Volume
* volume
);
28 status_t
Initialize();
30 status_t
AllocateBlocks(Transaction
& transaction
,
31 uint32 minimum
, uint32 maximum
, uint32
& blockGroup
,
32 fsblock_t
& start
, uint32
& length
);
33 status_t
Allocate(Transaction
& transaction
, Inode
* inode
,
34 off_t numBlocks
, uint32 minimum
, fsblock_t
& start
,
36 status_t
Free(Transaction
& transaction
, fsblock_t start
,
42 static status_t
_Initialize(BlockAllocator
* allocator
);
48 AllocationBlockGroup
* fGroups
;
49 uint32 fBlocksPerGroup
;
52 fsblock_t fFirstBlock
;
55 #endif // BLOCKALLOCATOR_H