#include "kernel/filesystem/mount.hpp" #include "kapi/system.hpp" #include "kernel/filesystem/dentry.hpp" #include "kernel/filesystem/filesystem.hpp" #include #include #include namespace kernel::filesystem { mount::mount(kstd::shared_ptr const & mount_dentry, kstd::shared_ptr const & root_dentry, kstd::shared_ptr const & fs, std::string_view mount_path, kstd::shared_ptr const & parent_mount) : m_mount_path(mount_path) , m_mount_dentry(mount_dentry) , m_root_dentry(root_dentry) , m_filesystem(fs) , m_parent_mount(parent_mount) { if (!m_filesystem) { kapi::system::panic("[FILESYSTEM] mount initialized with null filesystem."); } } auto mount::get_mount_dentry() const -> kstd::shared_ptr const & { return m_mount_dentry; } auto mount::get_filesystem() const -> kstd::shared_ptr const & { return m_filesystem; } auto mount::root_dentry() const -> kstd::shared_ptr const & { return m_root_dentry; } auto mount::get_mount_path() const -> std::string_view { return m_mount_path.view(); } auto mount::get_parent_mount() const -> kstd::shared_ptr const & { return m_parent_mount; } } // namespace kernel::filesystem