xref: /haiku/src/add-ons/kernel/file_systems/btrfs/Chunk.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2011, Haiku Inc. All rights reserved.
3  * This file may be used under the terms of the MIT License.
4  *
5  * Authors:
6  *		Jérôme Duval
7  *		Chế Vũ Gia Hy
8  */
9 #ifndef CHUNK_H
10 #define CHUNK_H
11 
12 
13 #include "btrfs.h"
14 
15 
16 class Chunk {
17 public:
18 								Chunk(btrfs_chunk* chunk,
19 									fsblock_t offset);
20 								~Chunk();
21 			uint32				Size() const;
22 			status_t			FindBlock(off_t logical, off_t& physical);
23 			fsblock_t			Offset() const { return fChunkOffset; }
24 			fsblock_t			End() const
25 									{ return fChunkOffset + fChunk->Length(); }
26 private:
27 			btrfs_chunk*	fChunk;
28 			fsblock_t			fChunkOffset;
29 			status_t			fInitStatus;
30 };
31 
32 #endif	// CHUNK_H
33