btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / ext2 / ExtentStream.h
blobdc12a5bc2002a900a22d8a70bea26849f86bfa86
1 /*
2 * Copyright 2001-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 */
8 #ifndef EXTENTSTREAM_H
9 #define EXTENTSTREAM_H
12 #include "ext2.h"
13 #include "Transaction.h"
16 class Volume;
19 class ExtentStream
21 public:
22 ExtentStream(Volume* volume, ext2_extent_stream* stream,
23 off_t size);
24 ~ExtentStream();
26 status_t FindBlock(off_t offset, fsblock_t& block,
27 uint32 *_count = NULL);
28 status_t Enlarge(Transaction& transaction, off_t& numBlocks);
29 status_t Shrink(Transaction& transaction, off_t& numBlocks);
30 void Init();
32 bool Check();
34 private:
35 status_t _Check(ext2_extent_stream *stream, fileblock_t &block);
36 status_t _CheckBlock(ext2_extent_stream *stream, fsblock_t block);
38 Volume* fVolume;
39 ext2_extent_stream* fStream;
40 fsblock_t fFirstBlock;
42 fsblock_t fAllocatedPos;
44 off_t fNumBlocks;
45 off_t fSize;
48 #endif // EXTENTSTREAM_H