1//----------------------------------------------------------------------
2//  This software is part of the Haiku distribution and is covered
3//  by the MIT 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 <util/kernel_cpp.h>
14
15#include "Partition.h"
16#include "PhysicalPartition.h"
17#include "UdfDebug.h"
18
19/*! \brief Type 2 virtual partition
20
21	VirtualPartitions add an extra layer of indirection between logical
22	block numbers and physical block numbers, allowing the underlying
23	physical block numbers to be changed without changing the original
24	references to (virtual) logical block numbers.
25
26	Note that VirtualPartitions should be found only on sequentially written
27	media such as CD-R, per UDF-2.01 2.2.10.
28
29	See also UDF-2.01 2.2.8, UDF-2.01 2.2.10
30*/
31class VirtualPartition : public Partition {
32public:
33	VirtualPartition(PhysicalPartition &physicalPartition);
34	virtual ~VirtualPartition();
35	virtual status_t MapBlock(uint32 logicalBlock, off_t &physicalBlock);
36
37	status_t InitCheck();
38private:
39	PhysicalPartition fPhysicalPartition;
40};
41
42#endif	// _UDF_VIRTUAL_PARTITION_H
43