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 13*deac135dSSalvatore Benedetto #include <util/kernel_cpp.h> 144e77893bSTyler Dauwalder 154e77893bSTyler Dauwalder #include "Partition.h" 164e77893bSTyler Dauwalder #include "PhysicalPartition.h" 174e77893bSTyler Dauwalder #include "UdfDebug.h" 184e77893bSTyler Dauwalder 194e77893bSTyler Dauwalder /*! \brief Type 2 virtual partition 204e77893bSTyler Dauwalder 214e77893bSTyler Dauwalder VirtualPartitions add an extra layer of indirection between logical 224e77893bSTyler Dauwalder block numbers and physical block numbers, allowing the underlying 234e77893bSTyler Dauwalder physical block numbers to be changed without changing the original 244e77893bSTyler Dauwalder references to (virtual) logical block numbers. 254e77893bSTyler Dauwalder 264e77893bSTyler Dauwalder Note that VirtualPartitions should be found only on sequentially written 274e77893bSTyler Dauwalder media such as CD-R, per UDF-2.01 2.2.10. 284e77893bSTyler Dauwalder 294e77893bSTyler Dauwalder See also UDF-2.01 2.2.8, UDF-2.01 2.2.10 304e77893bSTyler Dauwalder */ 314e77893bSTyler Dauwalder class VirtualPartition : public Partition { 324e77893bSTyler Dauwalder public: 334e77893bSTyler Dauwalder VirtualPartition(PhysicalPartition &physicalPartition); 344e77893bSTyler Dauwalder virtual ~VirtualPartition(); 35a1b5a724STyler Dauwalder virtual status_t MapBlock(uint32 logicalBlock, off_t &physicalBlock); 364e77893bSTyler Dauwalder 374e77893bSTyler Dauwalder status_t InitCheck(); 384e77893bSTyler Dauwalder private: 394e77893bSTyler Dauwalder PhysicalPartition fPhysicalPartition; 404e77893bSTyler Dauwalder }; 414e77893bSTyler Dauwalder 424e77893bSTyler Dauwalder #endif // _UDF_VIRTUAL_PARTITION_H 43