mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
Kernel: Split the ProcFS core file into smaller components
This commit is contained in:
parent
e882b2ed05
commit
3906dd3aa3
Notes:
sideshowbarker
2024-07-17 08:59:18 +09:00
Author: https://github.com/supercomputer7
Commit: 3906dd3aa3
Pull-request: https://github.com/SerenityOS/serenity/pull/15771
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/bgianfo
30 changed files with 1080 additions and 822 deletions
34
Kernel/FileSystem/ProcFS/FileSystem.cpp
Normal file
34
Kernel/FileSystem/ProcFS/FileSystem.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Spencer Dixon <spencercdixon@gmail.com>
|
||||
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/FileSystem/ProcFS/DirectoryInode.h>
|
||||
#include <Kernel/FileSystem/ProcFS/FileSystem.h>
|
||||
#include <Kernel/ProcessExposed.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<NonnullLockRefPtr<FileSystem>> ProcFS::try_create()
|
||||
{
|
||||
return TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) ProcFS));
|
||||
}
|
||||
|
||||
ProcFS::ProcFS() = default;
|
||||
ProcFS::~ProcFS() = default;
|
||||
|
||||
ErrorOr<void> ProcFS::initialize()
|
||||
{
|
||||
m_root_inode = static_ptr_cast<ProcFSDirectoryInode>(TRY(ProcFSComponentRegistry::the().root_directory().to_inode(*this)));
|
||||
return {};
|
||||
}
|
||||
|
||||
Inode& ProcFS::root_inode()
|
||||
{
|
||||
return *m_root_inode;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue