diff options
Diffstat (limited to 'kernel/src/filesystem/mount.cpp')
| -rw-r--r-- | kernel/src/filesystem/mount.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/kernel/src/filesystem/mount.cpp b/kernel/src/filesystem/mount.cpp index a2c501f..afc07fa 100644 --- a/kernel/src/filesystem/mount.cpp +++ b/kernel/src/filesystem/mount.cpp @@ -2,16 +2,21 @@ #include "kapi/system.hpp" +#include "kernel/filesystem/dentry.hpp" #include "kernel/filesystem/filesystem.hpp" #include <kstd/memory> +#include <kstd/string> #include <string_view> namespace filesystem { - mount::mount(std::string_view const & path, kstd::shared_ptr<filesystem> const & fs) - : m_path(path) + mount::mount(kstd::shared_ptr<dentry> const & mount_dentry, kstd::shared_ptr<dentry> const & root_dentry, + kstd::shared_ptr<filesystem> const & fs, std::string_view mount_path) + : m_mount_path(mount_path) + , m_mount_dentry(mount_dentry) + , m_root_dentry(root_dentry) , m_filesystem(fs) { if (!m_filesystem) @@ -20,13 +25,23 @@ namespace filesystem } } - auto mount::path() const -> std::string_view + auto mount::get_mount_dentry() const -> kstd::shared_ptr<dentry> { - return m_path; + return m_mount_dentry; } auto mount::get_filesystem() const -> kstd::shared_ptr<filesystem> const & { return m_filesystem; } + + auto mount::root_dentry() const -> kstd::shared_ptr<dentry> const & + { + return m_root_dentry; + } + + auto mount::get_mount_path() const -> std::string_view + { + return m_mount_path.view(); + } } // namespace filesystem
\ No newline at end of file |
