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

Kernel: Turns global Custody and Inode tables into InlineLinkedLists

Yet more of this same thing. Each one of these patches has a small but
noticeable impact on the steady-state kmalloc numbers. :^)
This commit is contained in:
Andreas Kling 2019-08-08 11:08:27 +02:00
parent 07425580a8
commit 318068fe1b
5 changed files with 34 additions and 21 deletions

View file

@ -2,6 +2,7 @@
#include <AK/AKString.h>
#include <AK/Function.h>
#include <AK/InlineLinkedList.h>
#include <AK/RefCounted.h>
#include <AK/WeakPtr.h>
#include <Kernel/FileSystem/FileSystem.h>
@ -15,7 +16,9 @@ class InodeVMObject;
class InodeWatcher;
class LocalSocket;
class Inode : public RefCounted<Inode>, public Weakable<Inode> {
class Inode : public RefCounted<Inode>
, public Weakable<Inode>
, public InlineLinkedListNode<Inode> {
friend class VFS;
friend class FS;
@ -77,6 +80,10 @@ public:
void register_watcher(Badge<InodeWatcher>, InodeWatcher&);
void unregister_watcher(Badge<InodeWatcher>, InodeWatcher&);
// For InlineLinkedListNode.
Inode* m_next { nullptr };
Inode* m_prev { nullptr };
protected:
Inode(FS& fs, unsigned index);
void set_metadata_dirty(bool);