1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
5 // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //---------------------------------------------------------------------
7 #ifndef _UDF_SPARABLE_PARTITION_H
8 #define _UDF_SPARABLE_PARTITION_H
10 /*! \file SparablePartition.h
13 #include <util/kernel_cpp.h>
15 #include "UdfStructures.h"
16 #include "Partition.h"
19 /*! \brief Type 2 sparable partition
21 Sparable partitions provide a defect-managed partition
22 space for media that does not implicitly provide defect management,
23 such as CD-RW. Arbitrary packets of blocks in the sparable partition
24 may be transparently remapped to other locations on disc should the
25 original locations become defective.
27 Per UDF-2.01 2.2.11, sparable partitions shall be recorded only on
28 disk/drive systems that do not perform defect management.
30 See also UDF-2.01 2.2.9, UDF-2.01 2.2.11
32 class SparablePartition
: public Partition
{
34 SparablePartition(uint16 number
, uint32 start
, uint32 length
, uint16 packetLength
,
35 uint8 tableCount
, uint32
*tableLocations
);
36 virtual ~SparablePartition();
37 virtual status_t
MapBlock(uint32 logicalBlock
, off_t
&physicalBlock
);
41 uint16
Number() const { return fNumber
; }
42 uint32
Start() const { return fStart
; }
43 uint32
Length() const { return fLength
; }
44 uint32
PacketLength() const { return fPacketLength
; }
45 uint8
TableCount() const { return fTableCount
; }
47 //! Maximum number of redundant sparing tables per SparablePartition
48 static const uint8 kMaxSparingTableCount
= UDF_MAX_SPARING_TABLE_COUNT
;
55 uint32 fTableLocations
[kMaxSparingTableCount
];
59 #endif // _UDF_SPARABLE_PARTITION_H