aboutsummaryrefslogtreecommitdiff
path: root/kernel/kernel/filesystem/inode.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kernel/filesystem/inode.hpp')
-rw-r--r--kernel/kernel/filesystem/inode.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/kernel/filesystem/inode.hpp b/kernel/kernel/filesystem/inode.hpp
index afe15e7d..677c5155 100644
--- a/kernel/kernel/filesystem/inode.hpp
+++ b/kernel/kernel/filesystem/inode.hpp
@@ -3,6 +3,7 @@
#include <kapi/filesystem.hpp>
+#include <kstd/memory.hpp>
#include <kstd/result.hpp>
#include <kstd/units.hpp>
@@ -12,6 +13,8 @@
namespace kernel::filesystem
{
+ struct mount;
+
//! An inode in the filesystem.
//!
//! Specific filesystems, or other subsystems, may provide their own implementation of this abstract base class. For
@@ -102,6 +105,24 @@ namespace kernel::filesystem
[[nodiscard]] virtual auto raw_device() const -> std::optional<kapi::filesystem::device_number>;
//! @}
+
+ //! @name Mount Resolution
+ //! @{
+
+ //! Get the mount this inode belongs to.
+ //!
+ //! @return The mount this inode belongs to.
+ [[nodiscard]] auto owning_mount() const noexcept -> kstd::weak_ptr<mount>;
+
+ //! Define which mount this inode belongs to.
+ //!
+ //! @param source The mount this inode belongs to.
+ auto set_owning_mount(kstd::shared_ptr<mount> const & source) noexcept -> void;
+
+ //! @}
+
+ private:
+ kstd::weak_ptr<mount> m_owning_mount{};
};
} // namespace kernel::filesystem