mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
Kernel: Switch Inode to IntrusiveList from InlineLinkedList
This commit is contained in:
parent
971f4ca71c
commit
493d4d1cd7
Notes:
sideshowbarker
2024-07-18 17:21:42 +09:00
Author: https://github.com/bgianfo
Commit: 493d4d1cd7
Pull-request: https://github.com/SerenityOS/serenity/pull/7479
2 changed files with 10 additions and 19 deletions
|
@ -21,14 +21,9 @@
|
|||
namespace Kernel {
|
||||
|
||||
static SpinLock s_all_inodes_lock;
|
||||
static AK::Singleton<InlineLinkedList<Inode>> s_list;
|
||||
static AK::Singleton<Inode::List> s_list;
|
||||
|
||||
SpinLock<u32>& Inode::all_inodes_lock()
|
||||
{
|
||||
return s_all_inodes_lock;
|
||||
}
|
||||
|
||||
InlineLinkedList<Inode>& Inode::all_with_lock()
|
||||
static Inode::List& all_with_lock()
|
||||
{
|
||||
VERIFY(s_all_inodes_lock.is_locked());
|
||||
|
||||
|
@ -103,13 +98,13 @@ Inode::Inode(FS& fs, InodeIndex index)
|
|||
, m_index(index)
|
||||
{
|
||||
ScopedSpinLock all_inodes_lock(s_all_inodes_lock);
|
||||
all_with_lock().append(this);
|
||||
all_with_lock().append(*this);
|
||||
}
|
||||
|
||||
Inode::~Inode()
|
||||
{
|
||||
ScopedSpinLock all_inodes_lock(s_all_inodes_lock);
|
||||
all_with_lock().remove(this);
|
||||
all_with_lock().remove(*this);
|
||||
|
||||
for (auto& watcher : m_watchers) {
|
||||
watcher->unregister_by_inode({}, identifier());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue