xref: /haiku/src/add-ons/kernel/file_systems/udf/VirtualPartition.h (revision a1b5a724edc0e6fd4608de040e041f96dad62db4)
14e77893bSTyler Dauwalder //----------------------------------------------------------------------
24e77893bSTyler Dauwalder //  This software is part of the OpenBeOS distribution and is covered
34e77893bSTyler Dauwalder //  by the OpenBeOS license.
44e77893bSTyler Dauwalder //
54e77893bSTyler Dauwalder //  Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
64e77893bSTyler Dauwalder //---------------------------------------------------------------------
74e77893bSTyler Dauwalder #ifndef _UDF_VIRTUAL_PARTITION_H
84e77893bSTyler Dauwalder #define _UDF_VIRTUAL_PARTITION_H
94e77893bSTyler Dauwalder 
104e77893bSTyler Dauwalder /*! \file VirtualPartition.h
114e77893bSTyler Dauwalder */
124e77893bSTyler Dauwalder 
134e77893bSTyler Dauwalder #include <kernel_cpp.h>
144e77893bSTyler Dauwalder 
154e77893bSTyler Dauwalder #include "Partition.h"
164e77893bSTyler Dauwalder #include "PhysicalPartition.h"
174e77893bSTyler Dauwalder #include "UdfDebug.h"
184e77893bSTyler Dauwalder 
194e77893bSTyler Dauwalder namespace Udf {
204e77893bSTyler Dauwalder 
214e77893bSTyler Dauwalder /*! \brief Type 2 virtual partition
224e77893bSTyler Dauwalder 
234e77893bSTyler Dauwalder 	VirtualPartitions add an extra layer of indirection between logical
244e77893bSTyler Dauwalder 	block numbers and physical block numbers, allowing the underlying
254e77893bSTyler Dauwalder 	physical block numbers to be changed without changing the original
264e77893bSTyler Dauwalder 	references to (virtual) logical block numbers.
274e77893bSTyler Dauwalder 
284e77893bSTyler Dauwalder 	Note that VirtualPartitions should be found only on sequentially written
294e77893bSTyler Dauwalder 	media such as CD-R, per UDF-2.01 2.2.10.
304e77893bSTyler Dauwalder 
314e77893bSTyler Dauwalder 	See also UDF-2.01 2.2.8, UDF-2.01 2.2.10
324e77893bSTyler Dauwalder */
334e77893bSTyler Dauwalder class VirtualPartition : public Partition {
344e77893bSTyler Dauwalder public:
354e77893bSTyler Dauwalder 	VirtualPartition(PhysicalPartition &physicalPartition);
364e77893bSTyler Dauwalder 	virtual ~VirtualPartition();
37*a1b5a724STyler Dauwalder 	virtual status_t MapBlock(uint32 logicalBlock, off_t &physicalBlock);
384e77893bSTyler Dauwalder 
394e77893bSTyler Dauwalder 	status_t InitCheck();
404e77893bSTyler Dauwalder private:
414e77893bSTyler Dauwalder 	PhysicalPartition fPhysicalPartition;
424e77893bSTyler Dauwalder };
434e77893bSTyler Dauwalder 
444e77893bSTyler Dauwalder };	// namespace Udf
454e77893bSTyler Dauwalder 
464e77893bSTyler Dauwalder #endif	// _UDF_VIRTUAL_PARTITION_H
47