diff --git a/src/add-ons/kernel/file_systems/udf/VirtualPartition.cpp b/src/add-ons/kernel/file_systems/udf/VirtualPartition.cpp new file mode 100644 index 0000000000..64375d74ea --- /dev/null +++ b/src/add-ons/kernel/file_systems/udf/VirtualPartition.cpp @@ -0,0 +1,44 @@ +#include "VirtualPartition.h" + +#define B_NOT_IMPLEMENTED B_ERROR + +using namespace Udf; + +/*! \brief Creates a new VirtualPartition object. + + VirtualPartition objects require a valid VAT to be found on disc. This involves + looking up the last recorded sector on the disc (via the "READ CD RECORDED + CAPACITY" SCSI-MMC call (code 0x25)), which should contain the file entry for + the VAT. Once found, the VAT can be loaded and accessed like a normal file. +*/ +VirtualPartition::VirtualPartition(PhysicalPartition &physicalPartition) + : fPhysicalPartition(physicalPartition) +{ + // Find VAT +} + +/*! \brief Destroys the VirtualPartition object. +*/ +VirtualPartition::~VirtualPartition() +{ +} + +/*! \brief Maps the given logical block to a physical block on disc. + + The given logical block is indexed into the VAT. If a corresponding + mapped block exists, that block is mapped to a physical block via the + VirtualPartition object's physical partition. +*/ +status_t +VirtualPartition::MapBlock(uint32 logicalBlock, uint32 &physicalBlock) +{ + return B_NOT_IMPLEMENTED; +} + +/*! Returns the initialization status of the object. +*/ +status_t +VirtualPartition::InitCheck() +{ + return B_NO_INIT; +} diff --git a/src/add-ons/kernel/file_systems/udf/VirtualPartition.h b/src/add-ons/kernel/file_systems/udf/VirtualPartition.h new file mode 100644 index 0000000000..1b8db091db --- /dev/null +++ b/src/add-ons/kernel/file_systems/udf/VirtualPartition.h @@ -0,0 +1,46 @@ +//---------------------------------------------------------------------- +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +// +// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net +//--------------------------------------------------------------------- +#ifndef _UDF_VIRTUAL_PARTITION_H +#define _UDF_VIRTUAL_PARTITION_H + +/*! \file VirtualPartition.h +*/ + +#include + +#include "Partition.h" +#include "PhysicalPartition.h" +#include "UdfDebug.h" + +namespace Udf { + +/*! \brief Type 2 virtual partition + + VirtualPartitions add an extra layer of indirection between logical + block numbers and physical block numbers, allowing the underlying + physical block numbers to be changed without changing the original + references to (virtual) logical block numbers. + + Note that VirtualPartitions should be found only on sequentially written + media such as CD-R, per UDF-2.01 2.2.10. + + See also UDF-2.01 2.2.8, UDF-2.01 2.2.10 +*/ +class VirtualPartition : public Partition { +public: + VirtualPartition(PhysicalPartition &physicalPartition); + virtual ~VirtualPartition(); + virtual status_t MapBlock(uint32 logicalBlock, uint32 &physicalBlock); + + status_t InitCheck(); +private: + PhysicalPartition fPhysicalPartition; +}; + +}; // namespace Udf + +#endif // _UDF_VIRTUAL_PARTITION_H