1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 01:45:08 +00:00
serenity/Kernel/FileSystem/ProcFS/FileSystem.h
Liav A c56e1c5378 Kernel/FileSystem: Simplify the ProcFS significantly
Since the ProcFS doesn't hold many global objects within it, the need
for a fully-structured design of backing components and a registry like
with the SysFS is no longer true.

To acommodate this, let's remove all backing store and components of the
ProcFS, so now it resembles what we had in the early days of ProcFS in
the project - a mostly-static filesystem, with very small amount of
kmalloc allocations needed.
We still use the inode index mechanism to understand the role of each
inode, but this is done in a much "static"ier way than before.
2023-02-24 22:14:18 +01:00

38 lines
815 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/Forward.h>
namespace Kernel {
class ProcFSInode;
class ProcFS final : public FileSystem {
friend class ProcFSInode;
friend class Process;
public:
virtual ~ProcFS() override;
static ErrorOr<NonnullLockRefPtr<FileSystem>> try_create();
virtual ErrorOr<void> initialize() override;
virtual StringView class_name() const override { return "ProcFS"sv; }
virtual Inode& root_inode() override;
private:
ProcFS();
ErrorOr<NonnullLockRefPtr<Inode>> get_inode(InodeIdentifier) const;
LockRefPtr<ProcFSInode> m_root_inode;
};
}