mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
Kernel/TmpFS: Use IntrusiveList and KString for OOM safety
This patch moves TmpFS to using OOM-safe data types for storing directory children.
This commit is contained in:
parent
b748f11f2d
commit
61e17ed590
2 changed files with 43 additions and 21 deletions
|
@ -75,18 +75,23 @@ private:
|
|||
TmpFSInode(TmpFS& fs, InodeMetadata metadata, InodeIdentifier parent);
|
||||
static RefPtr<TmpFSInode> create(TmpFS&, InodeMetadata metadata, InodeIdentifier parent);
|
||||
static RefPtr<TmpFSInode> create_root(TmpFS&);
|
||||
|
||||
void notify_watchers();
|
||||
|
||||
struct Child {
|
||||
NonnullOwnPtr<KString> name;
|
||||
NonnullRefPtr<TmpFSInode> inode;
|
||||
IntrusiveListNode<Child> list_node {};
|
||||
using List = IntrusiveList<Child, RawPtr<Child>, &Child::list_node>;
|
||||
};
|
||||
|
||||
Child* find_child_by_name(StringView);
|
||||
|
||||
InodeMetadata m_metadata;
|
||||
InodeIdentifier m_parent;
|
||||
|
||||
OwnPtr<KBuffer> m_content;
|
||||
struct Child {
|
||||
String name;
|
||||
NonnullRefPtr<TmpFSInode> inode;
|
||||
};
|
||||
HashMap<String, Child> m_children;
|
||||
|
||||
Child::List m_children;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue