mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 16:28:48 +00:00
This is done by merging all scattered pieces of derived classes from the ProcFSInode class into that one class, so we don't use inheritance but rather simplistic checks to determine the proper code for each ProcFS inode with its specific characteristics.
34 lines
784 B
C++
34 lines
784 B
C++
/*
|
|
* 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/FileSystem.h>
|
|
#include <Kernel/FileSystem/ProcFS/Inode.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 = TRY(ProcFSComponentRegistry::the().root_directory().to_inode(*this));
|
|
return {};
|
|
}
|
|
|
|
Inode& ProcFS::root_inode()
|
|
{
|
|
return *m_root_inode;
|
|
}
|
|
|
|
}
|