BlockDevicesDirectory.h 837 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <Kernel/FileSystem/SysFS/Component.h>
  8. #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/DeviceComponent.h>
  9. #include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h>
  10. namespace Kernel {
  11. class BlockDevice;
  12. class SysFSBlockDevicesDirectory final : public SysFSDirectory {
  13. public:
  14. virtual StringView name() const override { return "block"sv; }
  15. static NonnullRefPtr<SysFSBlockDevicesDirectory> must_create(SysFSDeviceIdentifiersDirectory const&);
  16. static SysFSBlockDevicesDirectory& the();
  17. ChildList& devices_list(Badge<BlockDevice>) { return m_child_components; }
  18. private:
  19. explicit SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const&);
  20. };
  21. }