btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / bin / bfs_tools / lib / Bitmap.h
blob5138c32b93f59ef5c8c3607f4a27c1d296b84644
1 /*
2 * Copyright 2001-2008, pinc Software. All Rights Reserved.
3 * Released under the terms of the MIT license.
4 */
5 #ifndef BITMAP_H
6 #define BITMAP_H
9 #include <SupportDefs.h>
11 class Disk;
12 class Inode;
15 class Bitmap {
16 public:
17 Bitmap(Disk *disk);
18 Bitmap();
19 ~Bitmap();
21 status_t SetTo(Disk *disk);
22 status_t InitCheck();
24 off_t FreeBlocks() const;
25 off_t UsedBlocks() const { return fUsedBlocks; }
27 bool UsedAt(off_t block) const;
28 bool BackupUsedAt(off_t block) const;
29 bool BackupSetAt(off_t block,bool used);
30 void BackupSet(Inode *inode,bool used);
32 status_t Validate();
33 status_t CompareWithBackup();
34 bool TrustBlockContaining(off_t block) const;
36 size_t Size() const { return fSize; }
38 private:
39 Disk *fDisk;
40 uint32 *fBitmap;
41 uint32 *fBackupBitmap;
42 size_t fSize;
43 size_t fByteSize;
44 off_t fUsedBlocks;
47 #endif /* BITMAP_H */