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/Registry.h>
|
2022-04-22 15:51:45 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/DeviceIdentifiers/BlockDevicesDirectory.h>
|
2022-04-22 12:46:19 +03:00
|
|
|
#include <Kernel/Sections.h>
|
|
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
2022-04-23 00:26:36 +03:00
|
|
|
static SysFSBlockDevicesDirectory* s_the { nullptr };
|
|
|
|
|
|
2022-08-19 20:53:40 +02:00
|
|
|
NonnullLockRefPtr<SysFSBlockDevicesDirectory> SysFSBlockDevicesDirectory::must_create(SysFSDeviceIdentifiersDirectory const& devices_directory)
|
2022-04-22 12:46:19 +03:00
|
|
|
{
|
2022-08-19 20:53:40 +02:00
|
|
|
return adopt_lock_ref_if_nonnull(new SysFSBlockDevicesDirectory(devices_directory)).release_nonnull();
|
2022-04-22 12:46:19 +03:00
|
|
|
}
|
2022-04-22 15:51:45 +03:00
|
|
|
SysFSBlockDevicesDirectory::SysFSBlockDevicesDirectory(SysFSDeviceIdentifiersDirectory const& devices_directory)
|
2022-04-22 12:46:19 +03:00
|
|
|
: SysFSDirectory(devices_directory)
|
|
|
|
|
{
|
2022-04-23 00:26:36 +03:00
|
|
|
s_the = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SysFSBlockDevicesDirectory& SysFSBlockDevicesDirectory::the()
|
|
|
|
|
{
|
|
|
|
|
VERIFY(s_the);
|
|
|
|
|
return *s_the;
|
2022-04-22 12:46:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|