mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Kernel: Make VirtualFileSystem::Mount a top-level class
And move it to its own compilation unit.
This commit is contained in:
parent
79552c91d5
commit
6a27de2d94
6 changed files with 109 additions and 62 deletions
39
Kernel/FileSystem/Mount.h
Normal file
39
Kernel/FileSystem/Mount.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <Kernel/FileSystem/Forward.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class Mount {
|
||||
public:
|
||||
Mount(FileSystem&, Custody* host_custody, int flags);
|
||||
Mount(Inode& source, Custody& host_custody, int flags);
|
||||
|
||||
Inode const* host() const;
|
||||
Inode* host();
|
||||
|
||||
Inode const& guest() const { return *m_guest; }
|
||||
Inode& guest() { return *m_guest; }
|
||||
|
||||
FileSystem const& guest_fs() const { return *m_guest_fs; }
|
||||
|
||||
String absolute_path() const;
|
||||
|
||||
int flags() const { return m_flags; }
|
||||
void set_flags(int flags) { m_flags = flags; }
|
||||
|
||||
private:
|
||||
NonnullRefPtr<Inode> m_guest;
|
||||
NonnullRefPtr<FileSystem> m_guest_fs;
|
||||
RefPtr<Custody> m_host_custody;
|
||||
int m_flags;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue