mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
Kernel: Split the TmpFS core files into smaller components
This commit is contained in:
parent
f53149d5f6
commit
5e6101dd3e
Notes:
sideshowbarker
2024-07-17 04:41:10 +09:00
Author: https://github.com/supercomputer7
Commit: 5e6101dd3e
Pull-request: https://github.com/SerenityOS/serenity/pull/15771
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/bgianfo
7 changed files with 85 additions and 59 deletions
39
Kernel/FileSystem/TmpFS/FileSystem.h
Normal file
39
Kernel/FileSystem/TmpFS/FileSystem.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
|
||||
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/FileSystem/FileSystem.h>
|
||||
#include <Kernel/FileSystem/Inode.h>
|
||||
#include <Kernel/Forward.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class TmpFS final : public FileSystem {
|
||||
friend class TmpFSInode;
|
||||
|
||||
public:
|
||||
virtual ~TmpFS() override;
|
||||
static ErrorOr<NonnullLockRefPtr<FileSystem>> try_create();
|
||||
virtual ErrorOr<void> initialize() override;
|
||||
|
||||
virtual StringView class_name() const override { return "TmpFS"sv; }
|
||||
|
||||
virtual bool supports_watchers() const override { return true; }
|
||||
|
||||
virtual Inode& root_inode() override;
|
||||
|
||||
private:
|
||||
TmpFS();
|
||||
|
||||
LockRefPtr<TmpFSInode> m_root_inode;
|
||||
|
||||
unsigned m_next_inode_index { 1 };
|
||||
unsigned next_inode_index();
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue