mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel/SysFS: Remove redundant SysFS& member from SysFSInode
This commit is contained in:
parent
d3cf4cd8f0
commit
d298de5e09
Notes:
sideshowbarker
2024-07-18 08:50:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d298de5e09a
2 changed files with 7 additions and 7 deletions
|
@ -170,7 +170,6 @@ NonnullRefPtr<SysFSDirectoryInode> SysFSDirectoryInode::create(SysFS const& sysf
|
|||
|
||||
SysFSDirectoryInode::SysFSDirectoryInode(SysFS const& fs, SysFSComponent const& component)
|
||||
: SysFSInode(fs, component)
|
||||
, m_parent_fs(const_cast<SysFS&>(fs))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -192,17 +191,17 @@ InodeMetadata SysFSDirectoryInode::metadata() const
|
|||
}
|
||||
KResult SysFSDirectoryInode::traverse_as_directory(Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||
{
|
||||
MutexLocker locker(m_parent_fs.m_lock);
|
||||
return m_associated_component->traverse_as_directory(m_parent_fs.fsid(), move(callback));
|
||||
MutexLocker locker(fs().m_lock);
|
||||
return m_associated_component->traverse_as_directory(fs().fsid(), move(callback));
|
||||
}
|
||||
|
||||
RefPtr<Inode> SysFSDirectoryInode::lookup(StringView name)
|
||||
{
|
||||
MutexLocker locker(m_parent_fs.m_lock);
|
||||
MutexLocker locker(fs().m_lock);
|
||||
auto component = m_associated_component->lookup(name);
|
||||
if (!component)
|
||||
return {};
|
||||
return component->to_inode(m_parent_fs);
|
||||
return component->to_inode(fs());
|
||||
}
|
||||
|
||||
SysFSBusDirectory& SysFSComponentRegistry::buses_directory()
|
||||
|
|
|
@ -106,14 +106,15 @@ public:
|
|||
static NonnullRefPtr<SysFSDirectoryInode> create(SysFS const&, SysFSComponent const&);
|
||||
virtual ~SysFSDirectoryInode() override;
|
||||
|
||||
SysFS& fs() { return static_cast<SysFS&>(Inode::fs()); }
|
||||
SysFS const& fs() const { return static_cast<SysFS const&>(Inode::fs()); }
|
||||
|
||||
protected:
|
||||
SysFSDirectoryInode(SysFS const&, SysFSComponent const&);
|
||||
// ^Inode
|
||||
virtual InodeMetadata metadata() const override;
|
||||
virtual KResult traverse_as_directory(Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||
virtual RefPtr<Inode> lookup(StringView name) override;
|
||||
|
||||
SysFS& m_parent_fs;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue