1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +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,15 +2,17 @@
#include <AK/AKString.h>
#include <AK/Badge.h>
#include <AK/RefPtr.h>
#include <AK/InlineLinkedList.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
class Inode;
class VFS;
// FIXME: Custody needs some locking.
class Custody : public RefCounted<Custody> {
class Custody : public RefCounted<Custody>
, public InlineLinkedListNode<Custody> {
public:
static Custody* get_if_cached(Custody* parent, const String& name);
static NonnullRefPtr<Custody> get_or_create(Custody* parent, const String& name, Inode&);
@ -35,6 +37,10 @@ public:
void did_mount_on(Badge<VFS>);
void did_rename(Badge<VFS>, const String& name);
// For InlineLinkedListNode.
Custody* m_next { nullptr };
Custody* m_prev { nullptr };
private:
Custody(Custody* parent, const String& name, Inode&);