2022-04-22 06: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-22 18:26:36 -03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h>
|
2022-04-22 09:51:45 -03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h>
|
2022-04-22 06:46:19 -03:00
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2022-07-16 04:39:57 -03:00
|
|
|
class BlockDevice;
|
2022-04-22 06:46:19 -03:00
|
|
|
class SysFSBlockDevicesDirectory final : public SysFSDirectory {
|
2022-04-23 05:48:40 -03:00
|
|
|
|
2022-04-22 06:46:19 -03:00
|
|
|
public:
|
|
|
|
|
virtual StringView name() const override { return "block"sv; }
|
2022-08-19 15:53:40 -03:00
|
|
|
static NonnullLockRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&);
|
2022-04-22 06:46:19 -03:00
|
|
|
|
2022-04-22 18:26:36 -03:00
|
|
|
static SysFSBlockDevicesDirectory& the();
|
|
|
|
|
|
2022-07-16 04:39:57 -03:00
|
|
|
ChildList& devices_list(Badge<BlockDevice>) { return m_child_components; }
|
2022-04-22 18:26:36 -03:00
|
|
|
|
2022-04-22 06:46:19 -03:00
|
|
|
private:
|
2022-04-22 09:51:45 -03:00
|
|
|
explicit SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const&);
|
2022-04-22 06:46:19 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|