aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/filesystem/mount_table.cpp
diff options
context:
space:
mode:
authorLukas Oesch <lukasoesch20@gmail.com>2026-05-10 19:08:07 +0200
committerLukas Oesch <lukasoesch20@gmail.com>2026-05-11 22:34:54 +0200
commit00aa2c8695b81944798010d81d600038e1f1ef3d (patch)
tree94c8fcfa182a18d5ec9b70f0fb4fe507225a1ac6 /kernel/src/filesystem/mount_table.cpp
parente05b52111d952c626c29d92a862ee0d1dce180f3 (diff)
downloadkernel-00aa2c8695b81944798010d81d600038e1f1ef3d.tar.xz
kernel-00aa2c8695b81944798010d81d600038e1f1ef3d.zip
remove mount_path from mount struct (retrieve path from m_mount_dentry)
Diffstat (limited to 'kernel/src/filesystem/mount_table.cpp')
-rw-r--r--kernel/src/filesystem/mount_table.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/src/filesystem/mount_table.cpp b/kernel/src/filesystem/mount_table.cpp
index 965e83b..b67e05c 100644
--- a/kernel/src/filesystem/mount_table.cpp
+++ b/kernel/src/filesystem/mount_table.cpp
@@ -37,7 +37,9 @@ namespace kernel::filesystem
kstd::vector<kstd::shared_ptr<mount>> const & mounts) -> bool
{
return std::ranges::none_of(mounts, [&](auto const & other) {
- return other != candidate && is_strict_prefix(other->get_mount_path(), candidate->get_mount_path()) &&
+ // TODO BA-FS26 really correct?
+ return other != candidate &&
+ is_strict_prefix(other->get_mount_path().view(), candidate->get_mount_path().view()) &&
!is_descendant_of(candidate, other);
});
}
@@ -80,6 +82,7 @@ namespace kernel::filesystem
return operation_result::removed;
}
+ // TODO BA-FS26 remove?
auto mount_table::find_longest_prefix_mount(std::string_view path) const -> kstd::shared_ptr<mount>
{
kstd::shared_ptr<mount> mount_with_longest_prefix = nullptr;
@@ -90,7 +93,7 @@ namespace kernel::filesystem
auto mp = mount->get_mount_path();
// /a/b/c should match /a/b but not /a/bb or /a/b/c/d, / should match everything
- bool is_prefix = path.starts_with(mp) && (mp == "/" || path.size() == mp.size() || path[mp.size()] == '/');
+ bool is_prefix = path.starts_with(mp.view()) && (mp == "/" || path.size() == mp.size() || path[mp.size()] == '/');
bool visible = is_visible_mount(mount, m_mounts);
if (is_prefix && visible && mp.size() >= best_len)