1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:17:44 +00:00

Kernel: Add an LRU block cache.

This papers over some of the incredibly inefficient access patterns in the
Ext2FS implementation for a while longer. :^)
This commit is contained in:
Andreas Kling 2019-02-10 20:07:14 +01:00
parent 052a101cc5
commit 7014daa235
3 changed files with 122 additions and 2 deletions

View file

@ -147,8 +147,7 @@ namespace AK {
template<>
struct Traits<InodeIdentifier> {
// FIXME: This is a shitty hash.
static unsigned hash(const InodeIdentifier& inode) { return Traits<unsigned>::hash(inode.fsid()) + Traits<unsigned>::hash(inode.index()); }
static unsigned hash(const InodeIdentifier& inode) { return pair_int_hash(inode.fsid(), inode.index()); }
static void dump(const InodeIdentifier& inode) { kprintf("%02u:%08u", inode.fsid(), inode.index()); }
};