1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

Kernel: Switch Inode to IntrusiveList from InlineLinkedList

This commit is contained in:
Brian Gianforcaro 2021-05-26 02:18:23 -07:00 committed by Andreas Kling
parent 971f4ca71c
commit 493d4d1cd7
2 changed files with 10 additions and 19 deletions

View file

@ -9,7 +9,7 @@
#include <AK/Function.h>
#include <AK/HashTable.h>
#include <AK/InlineLinkedList.h>
#include <AK/IntrusiveList.h>
#include <AK/RefCounted.h>
#include <AK/String.h>
#include <AK/WeakPtr.h>
@ -24,8 +24,7 @@
namespace Kernel {
class Inode : public RefCounted<Inode>
, public Weakable<Inode>
, public InlineLinkedListNode<Inode> {
, public Weakable<Inode> {
friend class VFS;
friend class FS;
@ -91,7 +90,6 @@ public:
RefPtr<SharedInodeVMObject> shared_vmobject() const;
bool is_shared_vmobject(const SharedInodeVMObject&) const;
static InlineLinkedList<Inode>& all_with_lock();
static void sync();
bool has_watchers() const { return !m_watchers.is_empty(); }
@ -101,12 +99,6 @@ public:
NonnullRefPtr<FIFO> fifo();
// For InlineLinkedListNode.
Inode* m_next { nullptr };
Inode* m_prev { nullptr };
static SpinLock<u32>& all_inodes_lock();
protected:
Inode(FS& fs, InodeIndex);
void set_metadata_dirty(bool);
@ -127,6 +119,10 @@ private:
HashTable<InodeWatcher*> m_watchers;
bool m_metadata_dirty { false };
RefPtr<FIFO> m_fifo;
IntrusiveListNode<Inode> m_inode_list_node;
public:
using List = IntrusiveList<Inode, RawPtr<Inode>, &Inode::m_inode_list_node>;
};
}