mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
Kernel: Split the SysFS core files into smaller components
This commit is contained in:
parent
7eed3dab5d
commit
f53149d5f6
19 changed files with 234 additions and 148 deletions
33
Kernel/FileSystem/SysFS/FileSystem.cpp
Normal file
33
Kernel/FileSystem/SysFS/FileSystem.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <Kernel/FileSystem/SysFS/FileSystem.h>
|
||||
#include <Kernel/FileSystem/SysFS/Inode.h>
|
||||
#include <Kernel/FileSystem/SysFS/Registry.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<NonnullLockRefPtr<FileSystem>> SysFS::try_create()
|
||||
{
|
||||
return TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) SysFS));
|
||||
}
|
||||
|
||||
SysFS::SysFS() = default;
|
||||
SysFS::~SysFS() = default;
|
||||
|
||||
ErrorOr<void> SysFS::initialize()
|
||||
{
|
||||
m_root_inode = TRY(SysFSComponentRegistry::the().root_directory().to_inode(*this));
|
||||
return {};
|
||||
}
|
||||
|
||||
Inode& SysFS::root_inode()
|
||||
{
|
||||
return *m_root_inode;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue