mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +00:00
Kernel/Ext2: Extract common calculations to functions
This also makes it easier to understand and reference where these (sometimes rather arbitrary) calculations come from. This also fixes a bug where group_index_from_block_index assumed 1KiB blocks.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
6a17a30e2e
commit
cc1cb72fb5
@@ -77,10 +77,12 @@ private:
|
||||
virtual void flush_writes() override;
|
||||
|
||||
BlockIndex first_block_index() const;
|
||||
BlockIndex first_block_of_block_group_descriptors() const;
|
||||
ErrorOr<InodeIndex> allocate_inode(GroupIndex preferred_group = 0);
|
||||
ErrorOr<Vector<BlockIndex>> allocate_blocks(GroupIndex preferred_group_index, size_t count);
|
||||
GroupIndex group_index_from_inode(InodeIndex) const;
|
||||
GroupIndex group_index_from_block_index(BlockIndex) const;
|
||||
BlockIndex first_block_of_group(GroupIndex) const;
|
||||
|
||||
ErrorOr<bool> get_inode_allocation_state(InodeIndex) const;
|
||||
ErrorOr<void> set_inode_allocation_state(InodeIndex, bool);
|
||||
|
||||
Reference in New Issue
Block a user