btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / btrfs / Chunk.h
blob1bc5bab9a692e555f3f404cf8c52e57d78092c13
1 /*
2 * Copyright 2011, Haiku Inc. All rights reserved.
3 * This file may be used under the terms of the MIT License.
5 * Authors:
6 * Jérôme Duval
7 * Chế Vũ Gia Hy
8 */
9 #ifndef CHUNK_H
10 #define CHUNK_H
13 #include "btrfs.h"
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;
32 #endif // CHUNK_H