2 * Copyright 2011, Jérôme Duval, korli@users.berlios.de.
3 * Copyright 2008-2010, Axel Dörfler, axeld@pinc-software.de.
4 * This file may be used under the terms of the MIT License.
14 VOLUME_READ_ONLY
= 0x0001
24 Volume(fs_volume
* volume
);
27 status_t
Mount(const char* device
, uint32 flags
);
30 bool IsValidSuperBlock();
31 bool IsReadOnly() const
32 { return (fFlags
& VOLUME_READ_ONLY
) != 0; }
34 Inode
* RootNode() const { return fRootNode
; }
35 int Device() const { return fDevice
; }
38 { return fFSVolume
? fFSVolume
->id
: -1; }
39 fs_volume
* FSVolume() const { return fFSVolume
; }
40 const char* Name() const;
41 BTree
* FSTree() const { return fFSTree
; }
42 BTree
* ExtentTree() const { return fExtentTree
; }
43 BTree
* RootTree() const { return fRootTree
; }
45 uint32
SectorSize() const { return fSectorSize
; }
46 uint32
BlockSize() const { return fBlockSize
; }
47 Chunk
* SystemChunk() const { return fChunk
; }
49 btrfs_super_block
& SuperBlock() { return fSuperBlock
; }
51 status_t
LoadSuperBlock();
54 void* BlockCache() { return fBlockCache
; }
56 static status_t
Identify(int fd
, btrfs_super_block
* superBlock
);
58 status_t
FindBlock(off_t logical
, fsblock_t
& physical
);
59 status_t
FindBlock(off_t logical
, off_t
& physical
);
65 btrfs_super_block fSuperBlock
;