1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

Add a very naive block cache to the DiskBackedFileSystem.

This would be a lot better as an LRU. Right now it's a 32-slot
hash table with random eviction.
This commit is contained in:
Andreas Kling 2018-10-25 12:35:49 +02:00
parent 82bbfa8496
commit fdc782c1d1
4 changed files with 36 additions and 3 deletions

View file

@ -2,6 +2,7 @@
#include "FileSystem.h"
#include <AK/ByteBuffer.h>
#include <AK/HashMap.h>
class DiskBackedFileSystem : public FileSystem {
public:
@ -27,4 +28,5 @@ protected:
private:
unsigned m_blockSize { 0 };
RetainPtr<DiskDevice> m_device;
mutable HashMap<unsigned, ByteBuffer> m_blockCache;
};