1 /* 2 * Copyright 2012, Jérôme Duval, korli@users.berlios.de. 3 * Copyright 2003 Tyler Dauwalder, tyler@dauwalder.net 4 * This file may be used under the terms of the MIT License. 5 */ 6 #ifndef _UDF_METADATA_PARTITION_H 7 #define _UDF_METADATA_PARTITION_H 8 9 /*! \file MetadataPartition.h 10 */ 11 12 #include <util/kernel_cpp.h> 13 14 #include "UdfDebug.h" 15 #include "Volume.h" 16 17 18 /*! \brief Type 2 metadata partition 19 20 Metadata partitions allow for clustering of metadata (ICBs, directory 21 contents, etc.) and also provide the option of metadata duplication. 22 23 See also UDF-2.50 2.2.10, UDF-2.50 2.2.13 24 */ 25 class MetadataPartition : public Partition { 26 public: 27 MetadataPartition(Volume *volume, uint16 partition, Partition &parentPartition, 28 uint32 metadataFileLocation, uint32 metadataMirrorFileLocation, 29 uint32 metadataBitmapFileLocation, uint32 allocationUnitSize, 30 uint16 alignmentUnitSize, bool metadataIsDuplicated); 31 virtual ~MetadataPartition(); 32 virtual status_t MapBlock(uint32 logicalBlock, off_t &physicalBlock); 33 34 status_t InitCheck(); 35 AllocationUnitSize()36 uint32 AllocationUnitSize() const { return fAllocationUnitSize; } AlignmentUnitSize()37 uint16 AlignmentUnitSize() const { return fAlignmentUnitSize; } MetadataIsDuplicated()38 uint32 MetadataIsDuplicated() const { return fMetadataIsDuplicated; } 39 private: 40 uint16 fPartition; 41 Partition &fParentPartition; 42 uint32 fAllocationUnitSize; 43 uint16 fAlignmentUnitSize; 44 bool fMetadataIsDuplicated; 45 status_t fInitStatus; 46 Icb *fMetadataIcb; 47 Icb *fMetadataMirrorIcb; 48 }; 49 50 #endif // _UDF_METADATA_PARTITION_H 51