Kernel/SysFS: Reduce the responsibilities of the Registry object

Instead, let the /sys/dev/block and /sys/dev/char directories to handle
the registering part of SysFSDeviceComponents by themselves.
This commit is contained in:
Liav A 2022-04-23 00:26:36 +03:00 committed by Andreas Kling
commit 6733f19b3c
Notes: sideshowbarker 2024-07-17 08:56:09 +09:00
11 changed files with 72 additions and 31 deletions

View file

@ -106,7 +106,7 @@ SysFSSymbolicLink::SysFSSymbolicLink(SysFSDirectory const& parent_directory, Sys
ErrorOr<void> SysFSDirectory::traverse_as_directory(FileSystemID fsid, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
{
MutexLocker locker(SysFSComponentRegistry::the().get_lock());
MutexLocker locker(m_traverse_lock);
VERIFY(m_parent_directory);
TRY(callback({ "."sv, { fsid, component_index() }, 0 }));
TRY(callback({ ".."sv, { fsid, m_parent_directory->component_index() }, 0 }));