xref: /haiku/src/add-ons/kernel/file_systems/udf/VirtualPartition.h (revision 9eb55bc1d104b8fda80898f8b25c94d8000c8255)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //
5 //  Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //---------------------------------------------------------------------
7 #ifndef _UDF_VIRTUAL_PARTITION_H
8 #define _UDF_VIRTUAL_PARTITION_H
9 
10 /*! \file VirtualPartition.h
11 */
12 
13 #include <kernel_cpp.h>
14 
15 #include "Partition.h"
16 #include "PhysicalPartition.h"
17 #include "UdfDebug.h"
18 
19 namespace Udf {
20 
21 /*! \brief Type 2 virtual partition
22 
23 	VirtualPartitions add an extra layer of indirection between logical
24 	block numbers and physical block numbers, allowing the underlying
25 	physical block numbers to be changed without changing the original
26 	references to (virtual) logical block numbers.
27 
28 	Note that VirtualPartitions should be found only on sequentially written
29 	media such as CD-R, per UDF-2.01 2.2.10.
30 
31 	See also UDF-2.01 2.2.8, UDF-2.01 2.2.10
32 */
33 class VirtualPartition : public Partition {
34 public:
35 	VirtualPartition(PhysicalPartition &physicalPartition);
36 	virtual ~VirtualPartition();
37 	virtual status_t MapBlock(uint32 logicalBlock, off_t &physicalBlock);
38 
39 	status_t InitCheck();
40 private:
41 	PhysicalPartition fPhysicalPartition;
42 };
43 
44 };	// namespace Udf
45 
46 #endif	// _UDF_VIRTUAL_PARTITION_H
47