mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02:00
Kernel: Add a write cache to DiskBackedFS.
This way you can spam small write()s on a file without the kernel writing to disk every single time. Flushes are included in the FS::sync() operation and will get triggered regularly by syncd. :^)
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 14:35:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/44673c4f3b0
@@ -12,6 +12,8 @@ public:
|
||||
|
||||
int block_size() const { return m_block_size; }
|
||||
|
||||
virtual void flush_writes() override;
|
||||
|
||||
protected:
|
||||
explicit DiskBackedFS(Retained<DiskDevice>&&);
|
||||
|
||||
@@ -26,4 +28,6 @@ protected:
|
||||
private:
|
||||
int m_block_size { 0 };
|
||||
Retained<DiskDevice> m_device;
|
||||
|
||||
HashMap<unsigned, ByteBuffer> m_write_cache;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user