2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
9 #include <SupportDefs.h>
24 Volume(boot::Partition
*partition
);
28 bool IsValidSuperBlock();
30 block_run
Root() const { return fSuperBlock
.root_dir
; }
31 Directory
*RootNode() const { return fRootNode
; }
32 block_run
Indices() const { return fSuperBlock
.indices
; }
33 const char *Name() const { return fSuperBlock
.name
; }
35 int Device() const { return fDevice
; }
37 off_t
NumBlocks() const { return fSuperBlock
.NumBlocks(); }
38 off_t
UsedBlocks() const { return fSuperBlock
.UsedBlocks(); }
39 off_t
FreeBlocks() const { return NumBlocks() - UsedBlocks(); }
41 uint32
BlockSize() const { return fSuperBlock
.BlockSize(); }
42 uint32
BlockShift() const { return fSuperBlock
.BlockShift(); }
43 uint32
InodeSize() const { return fSuperBlock
.InodeSize(); }
44 uint32
AllocationGroups() const { return fSuperBlock
.AllocationGroups(); }
45 uint32
AllocationGroupShift() const { return fSuperBlock
.AllocationGroupShift(); }
46 disk_super_block
&SuperBlock() { return fSuperBlock
; }
48 off_t
ToOffset(block_run run
) const { return ToBlock(run
) << BlockShift(); }
49 off_t
ToOffset(off_t block
) const { return block
<< BlockShift(); }
50 off_t
ToBlock(block_run run
) const { return ((off_t
)run
.AllocationGroup() << AllocationGroupShift()) | (uint32
)run
.Start(); }
51 block_run
ToBlockRun(off_t block
) const;
52 status_t
ValidateBlockRun(block_run run
);
54 off_t
ToVnode(block_run run
) const { return ToBlock(run
); }
55 off_t
ToVnode(off_t block
) const { return block
; }
59 disk_super_block fSuperBlock
;
61 BFS::Directory
*fRootNode
;