diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-11 00:46:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-11 00:51:06 +0200 |
commit | 6a27de2d946c649af0fe78dfef07f9e183af3af5 (patch) | |
tree | 6b0d6856e0d37517e1341dc48418b0997f844112 /Kernel/FileSystem/Mount.h | |
parent | 79552c91d5812c17914adea09ae2b8a94b153d0e (diff) | |
download | serenity-6a27de2d946c649af0fe78dfef07f9e183af3af5.zip |
Kernel: Make VirtualFileSystem::Mount a top-level class
And move it to its own compilation unit.
Diffstat (limited to 'Kernel/FileSystem/Mount.h')
-rw-r--r-- | Kernel/FileSystem/Mount.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Kernel/FileSystem/Mount.h b/Kernel/FileSystem/Mount.h new file mode 100644 index 0000000000..44397744cc --- /dev/null +++ b/Kernel/FileSystem/Mount.h @@ -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; +}; + +} |