2022-04-22 12:46:19 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <Kernel/FileSystem/SysFS/Component.h>
|
2022-04-23 00:26:36 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h>
|
2022-04-22 15:51:45 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h>
|
2022-04-22 12:46:19 +03:00
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2022-04-23 00:26:36 +03:00
|
|
|
class Device;
|
2022-04-22 12:46:19 +03:00
|
|
|
class SysFSBlockDevicesDirectory final : public SysFSDirectory {
|
|
|
|
|
public:
|
|
|
|
|
virtual StringView name() const override { return "block"sv; }
|
2022-04-22 15:51:45 +03:00
|
|
|
static NonnullRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&);
|
2022-04-22 12:46:19 +03:00
|
|
|
|
2022-04-23 00:26:36 +03:00
|
|
|
static SysFSBlockDevicesDirectory& the();
|
|
|
|
|
|
2022-04-23 01:06:37 +03:00
|
|
|
ChildList& devices_list(Badge<Device>) { return m_child_components; }
|
2022-04-23 00:26:36 +03:00
|
|
|
|
2022-04-22 12:46:19 +03:00
|
|
|
private:
|
2022-04-22 15:51:45 +03:00
|
|
|
explicit SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const&);
|
2022-04-22 12:46:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|