mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +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
|
@ -17,18 +17,13 @@ class SysFSBlockDevicesDirectory final : public SysFSDirectory {
|
|||
public:
|
||||
virtual StringView name() const override { return "block"sv; }
|
||||
static NonnullRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&);
|
||||
virtual ErrorOr<void> traverse_as_directory(FileSystemID, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override;
|
||||
virtual RefPtr<SysFSComponent> lookup(StringView name) override;
|
||||
|
||||
static SysFSBlockDevicesDirectory& the();
|
||||
|
||||
using DevicesList = SpinlockProtected<IntrusiveList<&SysFSDeviceComponent::m_list_node>>;
|
||||
DevicesList& devices_list(Badge<Device>) { return m_devices_list; }
|
||||
ChildList& devices_list(Badge<Device>) { return m_child_components; }
|
||||
|
||||
private:
|
||||
explicit SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const&);
|
||||
|
||||
DevicesList m_devices_list;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue