2022-04-22 12:46:19 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <Kernel/FileSystem/SysFS/RootDirectory.h>
|
2022-04-22 15:51:45 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/BlockDevicesDirectory.h>
|
|
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/CharacterDevicesDirectory.h>
|
|
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/Directory.h>
|
2022-04-22 12:46:19 +03:00
|
|
|
#include <Kernel/Sections.h>
|
|
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2022-04-22 15:51:45 +03:00
|
|
|
UNMAP_AFTER_INIT NonnullRefPtr<SysFSDeviceIdentifiersDirectory> SysFSDeviceIdentifiersDirectory::must_create(SysFSRootDirectory const& root_directory)
|
2022-04-22 12:46:19 +03:00
|
|
|
{
|
2022-04-22 15:51:45 +03:00
|
|
|
auto devices_directory = adopt_ref_if_nonnull(new SysFSDeviceIdentifiersDirectory(root_directory)).release_nonnull();
|
2022-04-22 12:46:19 +03:00
|
|
|
devices_directory->m_components.append(SysFSBlockDevicesDirectory::must_create(*devices_directory));
|
|
|
|
|
devices_directory->m_components.append(SysFSCharacterDevicesDirectory::must_create(*devices_directory));
|
|
|
|
|
return devices_directory;
|
|
|
|
|
}
|
2022-04-22 15:51:45 +03:00
|
|
|
SysFSDeviceIdentifiersDirectory::SysFSDeviceIdentifiersDirectory(SysFSRootDirectory const& root_directory)
|
2022-04-22 12:46:19 +03:00
|
|
|
: SysFSDirectory(root_directory)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|