diff options
| author | Marcel Braun <marcel.braun@ost.ch> | 2026-05-10 21:51:11 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukasoesch20@gmail.com> | 2026-05-11 22:35:56 +0200 |
| commit | 636551d03ac725e015dd88631d531c02067ed3de (patch) | |
| tree | 8ba247f0226895ea58c0d20dfd4af8c451ded872 /kernel/src/filesystem/vfs.cpp | |
| parent | 85fd2e3b4da7d84a9357b35bde740b780fe0cb72 (diff) | |
| download | kernel-636551d03ac725e015dd88631d531c02067ed3de.tar.xz kernel-636551d03ac725e015dd88631d531c02067ed3de.zip | |
Create first draft of get_parent_mount without find_longest_prefix_mount
Diffstat (limited to 'kernel/src/filesystem/vfs.cpp')
| -rw-r--r-- | kernel/src/filesystem/vfs.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/src/filesystem/vfs.cpp b/kernel/src/filesystem/vfs.cpp index 2b8c3bd..e7f9015 100644 --- a/kernel/src/filesystem/vfs.cpp +++ b/kernel/src/filesystem/vfs.cpp @@ -138,13 +138,13 @@ namespace kernel::filesystem auto vfs::do_mount_internal(kstd::shared_ptr<dentry> const & mount_point_dentry, kstd::shared_ptr<filesystem> const & fs) -> void { - auto mount_path = mount_point_dentry->get_absolute_path(); - // TODO BA-FS26 refactoring, implement dentry lookup to get the parent mount... - auto parent_mount = m_mount_table.find_longest_prefix_mount(mount_path.view()); - - // auto parent_mount_dentry = mount_point_dentry->get_parent_mounted_dentry(); - // auto parent_mount = m_mount_table.find_exact_mount(parent_mount_dentry->get_full_path()); - + auto parent_mount_dentry = mount_point_dentry->get_ancestor_with_mount_flag(); + kstd::shared_ptr<mount> parent_mount = nullptr; + if (parent_mount_dentry) + { + parent_mount = m_mount_table.find_exact_mount(parent_mount_dentry->get_absolute_path().view()); + } + auto new_fs_root = kstd::make_shared<dentry>(mount_point_dentry->get_parent(), fs->root_inode(), mount_point_dentry->get_name()); auto new_mount = kstd::make_shared<mount>(mount_point_dentry, new_fs_root, fs, parent_mount); |
