mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Ext2FS: Simplify inode creation by always starting empty
We had two ways of creating a new Ext2FS inode. Either they were empty, or they started with some pre-allocated size. In practice, the pre-sizing code path was only used for new directories and it didn't actually improve anything as far as I can tell. This patch simplifies inode creation by simply always allocating empty inodes. Block allocation and block list generation now always happens on the same code path.
This commit is contained in:
@@ -138,12 +138,12 @@ private:
|
||||
virtual const char* class_name() const override;
|
||||
virtual NonnullRefPtr<Inode> root_inode() const override;
|
||||
RefPtr<Inode> get_inode(InodeIdentifier) const;
|
||||
KResultOr<NonnullRefPtr<Inode>> create_inode(InodeIdentifier parent_id, const String& name, mode_t, off_t size, dev_t, uid_t, gid_t);
|
||||
KResultOr<NonnullRefPtr<Inode>> create_inode(InodeIdentifier parent_id, const String& name, mode_t, dev_t, uid_t, gid_t);
|
||||
KResult create_directory(InodeIdentifier parent_inode, const String& name, mode_t, uid_t, gid_t);
|
||||
virtual void flush_writes() override;
|
||||
|
||||
BlockIndex first_block_index() const;
|
||||
InodeIndex find_a_free_inode(GroupIndex preferred_group, off_t expected_size);
|
||||
InodeIndex find_a_free_inode(GroupIndex preferred_group = 0);
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user