From 7014daa2355d374c57ed09a4c55c460f0486d7f3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 10 Feb 2019 20:07:14 +0100 Subject: Kernel: Add an LRU block cache. This papers over some of the incredibly inefficient access patterns in the Ext2FS implementation for a while longer. :^) --- Kernel/FileSystem.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Kernel/FileSystem.h') diff --git a/Kernel/FileSystem.h b/Kernel/FileSystem.h index eab654ac51..a6564b0de9 100644 --- a/Kernel/FileSystem.h +++ b/Kernel/FileSystem.h @@ -147,8 +147,7 @@ namespace AK { template<> struct Traits { - // FIXME: This is a shitty hash. - static unsigned hash(const InodeIdentifier& inode) { return Traits::hash(inode.fsid()) + Traits::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()); } }; -- cgit v1.2.3