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:
parent
07425580a8
commit
318068fe1b
5 changed files with 34 additions and 21 deletions
|
@ -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&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue