mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:58:12 +00:00
Kernel/SysFS: Mark SysFSDirectory traverse and lookup methods as final
This enforces us to remove duplicated code across the SysFS code. This results in great simplification of how the SysFS works now, because we enforce one way to treat SysFSDirectory objects.
This commit is contained in:
parent
6733f19b3c
commit
70afa0b171
18 changed files with 114 additions and 178 deletions
|
@ -15,8 +15,12 @@ namespace Kernel {
|
|||
UNMAP_AFTER_INIT NonnullRefPtr<SysFSDeviceIdentifiersDirectory> SysFSDeviceIdentifiersDirectory::must_create(SysFSRootDirectory const& root_directory)
|
||||
{
|
||||
auto devices_directory = adopt_ref_if_nonnull(new SysFSDeviceIdentifiersDirectory(root_directory)).release_nonnull();
|
||||
devices_directory->m_components.append(SysFSBlockDevicesDirectory::must_create(*devices_directory));
|
||||
devices_directory->m_components.append(SysFSCharacterDevicesDirectory::must_create(*devices_directory));
|
||||
MUST(devices_directory->m_child_components.with([&](auto& list) -> ErrorOr<void> {
|
||||
list.append(SysFSBlockDevicesDirectory::must_create(*devices_directory));
|
||||
list.append(SysFSCharacterDevicesDirectory::must_create(*devices_directory));
|
||||
return {};
|
||||
}));
|
||||
|
||||
return devices_directory;
|
||||
}
|
||||
SysFSDeviceIdentifiersDirectory::SysFSDeviceIdentifiersDirectory(SysFSRootDirectory const& root_directory)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue