1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
5 // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //----------------------------------------------------------------------
8 /*! \file PhysicalPartitionAllocator.h
10 Udf physical partition allocator (declarations).
13 #ifndef _PHYSICAL_PARTITION_ALLOCATOR_H
14 #define _PHYSICAL_PARTITION_ALLOCATOR_H
18 #include "Allocator.h"
19 #include "UdfStructures.h"
21 /*! \brief Allocates blocks and extents from a Udf physical partition.
23 class PhysicalPartitionAllocator
{
25 PhysicalPartitionAllocator(uint16 number
, uint32 offset
, Allocator
&allocator
);
27 status_t
GetNextBlock(uint32
&block
, uint32
&physicalBlock
);
28 status_t
GetNextExtent(uint32 length
, bool contiguous
, long_address
&extent
,
29 extent_address
&physicalExtent
= dummyExtent
);
30 status_t
GetNextExtents(off_t length
, std::list
<long_address
> &extents
,
31 std::list
<extent_address
> &physicalExtents
);
34 uint16
PartitionNumber() const { return fNumber
; }
35 uint32
Length() const;
37 static extent_address dummyExtent
;
38 uint16 fNumber
; //!< The partition number of this partition
39 uint32 fOffset
; //!< The offset of the start of this partition in physical space
40 Allocator
&fAllocator
;
43 #endif // _PHYSICAL_PARTITION_ALLOCATOR_H