/* * Copyright (c) 2022, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include namespace Kernel { NonnullLockRefPtr SysFSRootDirectory::create() { return adopt_lock_ref(*new (nothrow) SysFSRootDirectory); } SysFSRootDirectory::SysFSRootDirectory() { auto buses_directory = SysFSBusDirectory::must_create(*this); auto device_identifiers_directory = SysFSDeviceIdentifiersDirectory::must_create(*this); auto devices_directory = SysFSDevicesDirectory::must_create(*this); auto global_kernel_stats_directory = SysFSGlobalKernelStatsDirectory::must_create(*this); MUST(m_child_components.with([&](auto& list) -> ErrorOr { list.append(buses_directory); list.append(device_identifiers_directory); list.append(devices_directory); list.append(global_kernel_stats_directory); return {}; })); m_buses_directory = buses_directory; } }