aboutsummaryrefslogtreecommitdiff
path: root/kernel/src/filesystem
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/filesystem')
-rw-r--r--kernel/src/filesystem/mount_table.cpp4
-rw-r--r--kernel/src/filesystem/mount_table.tests.cpp10
-rw-r--r--kernel/src/filesystem/vfs.cpp6
3 files changed, 10 insertions, 10 deletions
diff --git a/kernel/src/filesystem/mount_table.cpp b/kernel/src/filesystem/mount_table.cpp
index 4b61fb0..78ac727 100644
--- a/kernel/src/filesystem/mount_table.cpp
+++ b/kernel/src/filesystem/mount_table.cpp
@@ -31,7 +31,7 @@ namespace kernel::filesystem
auto mount_table::remove_mount(std::string_view path) -> operation_result
{
// TODO BA-FS26 check wheter something is open in this mount
- // TODO BA-FS26 nearly the same code is in find_exact_mount -> refactor to avoid code duplication
+ // TODO BA-FS26 nearly the same code is in find_mount -> refactor to avoid code duplication
auto mount_range =
std::ranges::find_last_if(m_mounts, [&](auto const & mount) { return mount->get_mount_path() == path; });
auto mount_it = mount_range.begin();
@@ -52,7 +52,7 @@ namespace kernel::filesystem
return operation_result::removed;
}
- auto mount_table::find_exact_mount(std::string_view path) const -> kstd::shared_ptr<mount>
+ auto mount_table::find_mount(std::string_view path) const -> kstd::shared_ptr<mount>
{
auto mount_range =
std::ranges::find_last_if(m_mounts, [&](auto const & mount) { return mount->get_mount_path() == path; });
diff --git a/kernel/src/filesystem/mount_table.tests.cpp b/kernel/src/filesystem/mount_table.tests.cpp
index 4ae8711..f22b25e 100644
--- a/kernel/src/filesystem/mount_table.tests.cpp
+++ b/kernel/src/filesystem/mount_table.tests.cpp
@@ -58,14 +58,14 @@ SCENARIO("Adding, finding and removing mounts in the mount table", "[filesystem]
THEN("finding mounts by exact valid path returns the correct mount")
{
- REQUIRE(table.find_exact_mount("/") == mount1);
- REQUIRE(table.find_exact_mount("/mnt") == mount2);
+ REQUIRE(table.find_mount("/") == mount1);
+ REQUIRE(table.find_mount("/mnt") == mount2);
}
THEN("finding mounts by exact invalid path returns null")
{
- REQUIRE(table.find_exact_mount("/nonexistent") == nullptr);
- REQUIRE(table.find_exact_mount("/mnt/file") == nullptr);
+ REQUIRE(table.find_mount("/nonexistent") == nullptr);
+ REQUIRE(table.find_mount("/mnt/file") == nullptr);
}
THEN("removing a mount that has no child mounts succeeds")
@@ -103,7 +103,7 @@ SCENARIO("Adding, finding and removing mounts in the mount table", "[filesystem]
THEN("finding mounts by exact valid path returns the correct mount")
{
- REQUIRE(table.find_exact_mount("/") == mount2);
+ REQUIRE(table.find_mount("/") == mount2);
}
THEN("removing the topmost mount with the same path succeeds")
diff --git a/kernel/src/filesystem/vfs.cpp b/kernel/src/filesystem/vfs.cpp
index c395e74..9b0440d 100644
--- a/kernel/src/filesystem/vfs.cpp
+++ b/kernel/src/filesystem/vfs.cpp
@@ -171,7 +171,7 @@ namespace kernel::filesystem
return {nullptr, nullptr};
}
- auto current_mount = m_mount_table.find_exact_mount("/");
+ auto current_mount = m_mount_table.find_mount("/");
if (!current_mount)
{
kapi::system::panic("[FILESYSTEM] no root mount found.");
@@ -232,7 +232,7 @@ namespace kernel::filesystem
}
else if (next_dentry->has_flag(dentry::dentry_flags::is_mount_point))
{
- current_mount = m_mount_table.find_exact_mount(next_dentry->get_absolute_path().view());
+ current_mount = m_mount_table.find_mount(next_dentry->get_absolute_path().view());
if (!current_mount)
{
kapi::system::panic("[FILESYSTEM] mount for dentry with mounted flag not found.");
@@ -260,7 +260,7 @@ namespace kernel::filesystem
if (path::is_valid_absolute_path(symbolic_link_path))
{
- current_mount = m_mount_table.find_exact_mount("/");
+ current_mount = m_mount_table.find_mount("/");
current_dentry = current_mount->get_root_dentry();
}
continue;