mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
Ext2FS: Share some bitmap code between inode and block allocation
Both inode and block allocation operate on bitmap blocks and update counters in the superblock and group descriptor. Since we're here, also add some error propagation around this code.
This commit is contained in:
parent
042152b346
commit
6352b4fd74
2 changed files with 60 additions and 76 deletions
|
@ -150,8 +150,8 @@ private:
|
|||
KResult write_block_list_for_inode(InodeIndex, ext2_inode&, const Vector<BlockIndex>&);
|
||||
|
||||
bool get_inode_allocation_state(InodeIndex) const;
|
||||
bool set_inode_allocation_state(InodeIndex, bool);
|
||||
bool set_block_allocation_state(BlockIndex, bool);
|
||||
KResult set_inode_allocation_state(InodeIndex, bool);
|
||||
KResult set_block_allocation_state(BlockIndex, bool);
|
||||
|
||||
void uncache_inode(InodeIndex);
|
||||
void free_inode(Ext2FSInode&);
|
||||
|
@ -189,6 +189,7 @@ private:
|
|||
};
|
||||
|
||||
CachedBitmap& get_bitmap_block(BlockIndex);
|
||||
KResult update_bitmap_block(BlockIndex bitmap_block, size_t bit_index, bool new_state, u32& super_block_counter, u16& group_descriptor_counter);
|
||||
|
||||
Vector<OwnPtr<CachedBitmap>> m_cached_bitmaps;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue