xref: /haiku/src/add-ons/kernel/file_systems/udf/MetadataPartition.h (revision a4ef4a49150f118d47324242917a596a3f8f8bd5)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //
5 //  Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //---------------------------------------------------------------------
7 #ifndef _UDF_METADATA_PARTITION_H
8 #define _UDF_METADATA_PARTITION_H
9 
10 /*! \file MetadataPartition.h
11 */
12 
13 #include <util/kernel_cpp.h>
14 
15 #include "Partition.h"
16 #include "UdfDebug.h"
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(Partition &parentPartition, uint32 metadataFileLocation,
28 	                  uint32 metadataMirrorFileLocation, uint32 metadataBitmapFileLocation,
29 	                  uint32 allocationUnitSize, uint16 alignmentUnitSize,
30 	                  bool metadataIsDuplicated);
31 	virtual ~MetadataPartition();
32 	virtual status_t MapBlock(uint32 logicalBlock, off_t &physicalBlock);
33 
34 	status_t InitCheck();
35 
36 	uint32 AllocationUnitSize() const { return fAllocationUnitSize; }
37 	uint16 AlignmentUnitSize() const { return fAlignmentUnitSize; }
38 	uint32 MetadataIsDuplicated() const { return fMetadataIsDuplicated; }
39 private:
40 	Partition &fParentPartition;
41 	uint32 fAllocationUnitSize;
42 	uint16 fAlignmentUnitSize;
43 	bool fMetadataIsDuplicated;
44 	status_t fInitStatus;
45 };
46 
47 #endif	// _UDF_METADATA_PARTITION_H
48