mirror of
https://github.com/RGBCube/serenity
synced 2025-06-16 10:12:10 +00:00
Ext2FS: Factor out block list generation and writing into functions.
This commit is contained in:
parent
6fb4033709
commit
29dfb4ae13
3 changed files with 89 additions and 6 deletions
|
@ -93,6 +93,7 @@ private:
|
|||
unsigned group_index_from_inode(unsigned) const;
|
||||
|
||||
Vector<unsigned> block_list_for_inode(const ext2_inode&, bool include_block_list_blocks = false) const;
|
||||
bool write_block_list_for_inode(InodeIndex, ext2_inode&, Vector<BlockIndex>&&);
|
||||
|
||||
void dump_block_bitmap(unsigned groupIndex) const;
|
||||
void dump_inode_bitmap(unsigned groupIndex) const;
|
||||
|
@ -109,6 +110,16 @@ private:
|
|||
void uncache_inode(InodeIndex);
|
||||
void free_inode(Ext2FSInode&);
|
||||
|
||||
struct BlockListShape {
|
||||
unsigned direct_blocks { 0 };
|
||||
unsigned indirect_blocks { 0 };
|
||||
unsigned doubly_indirect_blocks { 0 };
|
||||
unsigned triply_indirect_blocks { 0 };
|
||||
unsigned meta_blocks { 0 };
|
||||
};
|
||||
|
||||
BlockListShape compute_block_list_shape(unsigned blocks);
|
||||
|
||||
unsigned m_blockGroupCount { 0 };
|
||||
|
||||
mutable ByteBuffer m_cached_super_block;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue