#include "kernel/filesystem/mount_table.hpp" #include "kapi/system.hpp" #include "kernel/filesystem/dentry.hpp" #include "kernel/filesystem/mount.hpp" #include #include namespace filesystem { void mount_table::add_mount(kstd::shared_ptr mount) { m_mounts.push_back(mount); } auto mount_table::find_mount_by_dentry(kstd::shared_ptr const & dentry) -> kstd::shared_ptr { auto it = std::ranges::find_if(m_mounts, [&](auto const & mount) { return mount->get_dentry().get() == dentry.get(); }); if (it != m_mounts.end()) { return *it; } kapi::system::panic("[FILESYSTEM] dentry has mount flag set but no corresponding mount found."); } } // namespace filesystem