mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00

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.
29 lines
826 B
C++
29 lines
826 B
C++
/*
|
|
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Kernel/FileSystem/SysFS/Component.h>
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h>
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class Device;
|
|
class SysFSBlockDevicesDirectory final : public SysFSDirectory {
|
|
public:
|
|
virtual StringView name() const override { return "block"sv; }
|
|
static NonnullRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&);
|
|
|
|
static SysFSBlockDevicesDirectory& the();
|
|
|
|
ChildList& devices_list(Badge<Device>) { return m_child_components; }
|
|
|
|
private:
|
|
explicit SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const&);
|
|
};
|
|
|
|
}
|