1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-29 03:42:07 +00:00

Ext2FS: Flush the super block and block group descriptors lazily

Keep dirty bits for these and override flush_writes() so that we can
coalesce writes. Looks like a ~5x write performance bump on the
disk_benchmark.
This commit is contained in:
Andreas Kling 2019-11-02 11:36:56 +01:00
parent f2a9bbe96e
commit e4b7786b66
2 changed files with 23 additions and 6 deletions

View file

@ -98,6 +98,7 @@ private:
virtual RefPtr<Inode> create_inode(InodeIdentifier parentInode, const String& name, mode_t, off_t size, dev_t, int& error) override;
virtual RefPtr<Inode> create_directory(InodeIdentifier parentInode, const String& name, mode_t, int& error) override;
virtual RefPtr<Inode> get_inode(InodeIdentifier) const override;
virtual void flush_writes() override;
BlockIndex first_block_index() const;
InodeIndex allocate_inode(GroupIndex preferred_group, off_t expected_size);
@ -132,6 +133,9 @@ private:
mutable ByteBuffer m_cached_group_descriptor_table;
mutable HashMap<BlockIndex, RefPtr<Ext2FSInode>> m_inode_cache;
bool m_super_block_dirty { false };
bool m_block_group_descriptors_dirty { false };
};
inline Ext2FS& Ext2FSInode::fs()