mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel/FileSystem: Add the DevLoopFS filesystem
Similarly to DevPtsFS, this filesystem is about exposing loop device nodes easily in /dev/loop, so userspace doesn't need to do anything in order to use new devices immediately.
This commit is contained in:
39
Kernel/FileSystem/DevLoopFS/FileSystem.h
Normal file
39
Kernel/FileSystem/DevLoopFS/FileSystem.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/FileSystem/FileSystem.h>
|
||||
#include <Kernel/FileSystem/Inode.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class LoopDevice;
|
||||
class DevLoopFSInode;
|
||||
|
||||
class DevLoopFS final : public FileSystem {
|
||||
friend class DevLoopFSInode;
|
||||
|
||||
public:
|
||||
virtual ~DevLoopFS() override;
|
||||
static ErrorOr<NonnullRefPtr<FileSystem>> try_create(ReadonlyBytes);
|
||||
|
||||
virtual ErrorOr<void> initialize() override;
|
||||
virtual StringView class_name() const override { return "DevLoopFS"sv; }
|
||||
|
||||
virtual Inode& root_inode() override;
|
||||
|
||||
private:
|
||||
virtual u8 internal_file_type_to_directory_entry_type(DirectoryEntryView const& entry) const override;
|
||||
|
||||
DevLoopFS();
|
||||
ErrorOr<NonnullRefPtr<Inode>> get_inode(InodeIdentifier) const;
|
||||
|
||||
RefPtr<DevLoopFSInode> m_root_inode;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user