From 9be2e8bd9e1be9398fe85e2abd9c7afc69880e13 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Sun, 2 Nov 2003 01:11:39 +0000 Subject: [PATCH] Initial checkin. Mostly empty implementation of UDF 2.50 metadata partitions. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5230 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../file_systems/udf/MetadataPartition.cpp | 44 ++++++++++++++++ .../file_systems/udf/MetadataPartition.h | 51 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 src/add-ons/kernel/file_systems/udf/MetadataPartition.cpp create mode 100644 src/add-ons/kernel/file_systems/udf/MetadataPartition.h diff --git a/src/add-ons/kernel/file_systems/udf/MetadataPartition.cpp b/src/add-ons/kernel/file_systems/udf/MetadataPartition.cpp new file mode 100644 index 0000000000..bd4dec22b7 --- /dev/null +++ b/src/add-ons/kernel/file_systems/udf/MetadataPartition.cpp @@ -0,0 +1,44 @@ +#include "MetadataPartition.h" + +#define B_NOT_IMPLEMENTED B_ERROR + +using namespace Udf; + +/*! \brief Creates a new MetadataPartition object. +*/ +MetadataPartition::MetadataPartition(Partition &parentPartition, + uint32 metadataFileLocation, + uint32 metadataMirrorFileLocation, + uint32 metadataBitmapFileLocation, + uint32 allocationUnitSize, + uint16 alignmentUnitSize, + bool metadataIsDuplicated) + : fParentPartition(parentPartition) + , fAllocationUnitSize(allocationUnitSize) + , fAlignmentUnitSize(alignmentUnitSize) + , fMetadataIsDuplicated(metadataIsDuplicated) + , fInitStatus(B_NO_INIT) +{ +} + +/*! \brief Destroys the MetadataPartition object. +*/ +MetadataPartition::~MetadataPartition() +{ +} + +/*! \brief Maps the given logical block to a physical block on disc. +*/ +status_t +MetadataPartition::MapBlock(uint32 logicalBlock, uint32 &physicalBlock) +{ + return B_NOT_IMPLEMENTED; +} + +/*! Returns the initialization status of the object. +*/ +status_t +MetadataPartition::InitCheck() +{ + return fInitStatus; +} diff --git a/src/add-ons/kernel/file_systems/udf/MetadataPartition.h b/src/add-ons/kernel/file_systems/udf/MetadataPartition.h new file mode 100644 index 0000000000..35cde8546e --- /dev/null +++ b/src/add-ons/kernel/file_systems/udf/MetadataPartition.h @@ -0,0 +1,51 @@ +//---------------------------------------------------------------------- +// 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_METADATA_PARTITION_H +#define _UDF_METADATA_PARTITION_H + +/*! \file MetadataPartition.h +*/ + +#include + +#include "Partition.h" +#include "UdfDebug.h" + +namespace Udf { + +/*! \brief Type 2 metadata partition + + Metadata partitions allow for clustering of metadata (ICBs, directory + contents, etc.) and also provide the option of metadata duplication. + + See also UDF-2.50 2.2.10, UDF-2.50 2.2.13 +*/ +class MetadataPartition : public Partition { +public: + MetadataPartition(Partition &parentPartition, uint32 metadataFileLocation, + uint32 metadataMirrorFileLocation, uint32 metadataBitmapFileLocation, + uint32 allocationUnitSize, uint16 alignmentUnitSize, + bool metadataIsDuplicated); + virtual ~MetadataPartition(); + virtual status_t MapBlock(uint32 logicalBlock, uint32 &physicalBlock); + + status_t InitCheck(); + + uint32 AllocationUnitSize() const { return fAllocationUnitSize; } + uint16 AlignmentUnitSize() const { return fAlignmentUnitSize; } + uint32 MetadataIsDuplicated() const { return fMetadataIsDuplicated; } +private: + Partition &fParentPartition; + uint32 fAllocationUnitSize; + uint16 fAlignmentUnitSize; + bool fMetadataIsDuplicated; + status_t fInitStatus; +}; + +}; // namespace Udf + +#endif // _UDF_METADATA_PARTITION_H