btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / src / add-ons / kernel / file_systems / ext2 / HTreeEntryIterator.h
blob73a432eec2336d75136e68ebc60c3ee5c9f056cb
1 /*
2 * Copyright 2010, Haiku Inc. All rights reserved.
3 * This file may be used under the terms of the MIT License.
5 * Authors:
6 * Janito V. Ferreira Filho
7 */
8 #ifndef HTREE_ENTRY_ITERATOR_H
9 #define HTREE_ENTRY_ITERATOR_H
12 #include <AutoDeleter.h>
14 #include "DirectoryIterator.h"
17 class Volume;
20 class HTreeEntryIterator {
21 public:
22 HTreeEntryIterator(off_t offset,
23 Inode* directory);
24 ~HTreeEntryIterator();
26 status_t Init();
28 status_t Lookup(uint32 hash, int indirections,
29 DirectoryIterator** iterator,
30 bool& detachRoot);
31 bool HasCollision() { return fHasCollision; }
33 status_t GetNext(uint32& offset);
35 uint32 BlocksNeededForNewEntry();
36 status_t InsertEntry(Transaction& transaction,
37 uint32 hash, off_t block,
38 off_t newBlocksPos, bool hasCollision);
39 private:
40 HTreeEntryIterator(uint32 block,
41 uint32 blockSize, Inode* directory,
42 HTreeEntryIterator* parent,
43 bool hasCollision);
45 private:
46 Inode* fDirectory;
47 Volume* fVolume;
48 status_t fInitStatus;
50 bool fHasCollision;
51 uint16 fLimit, fCount;
52 uint16 fFirstEntry;
53 uint16 fCurrentEntry;
55 uint32 fBlockSize;
56 fsblock_t fBlockNum;
58 HTreeEntryIterator* fParent;
59 HTreeEntryIterator* fChild;
62 #endif // HTREE_ENTRY_ITERATOR_H