diff options
| author | Lukas Oesch <lukasoesch20@gmail.com> | 2026-05-15 16:50:55 +0200 |
|---|---|---|
| committer | Lukas Oesch <lukasoesch20@gmail.com> | 2026-05-16 11:56:07 +0200 |
| commit | 1d647adb1ba20121eeb5c8e4470f48b2e972b3d4 (patch) | |
| tree | d74522980f1853a6be0628158534c29cf48bdb1c /kernel/src/filesystem/mount_table.cpp | |
| parent | 95ff59017db74a6988f791ca9f122254dd743541 (diff) | |
| download | kernel-1d647adb1ba20121eeb5c8e4470f48b2e972b3d4.tar.xz kernel-1d647adb1ba20121eeb5c8e4470f48b2e972b3d4.zip | |
Mount can only be unmounted if no references are present, increment references on open file and decrement on close file
Diffstat (limited to 'kernel/src/filesystem/mount_table.cpp')
| -rw-r--r-- | kernel/src/filesystem/mount_table.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/src/filesystem/mount_table.cpp b/kernel/src/filesystem/mount_table.cpp index b582fd9..9951590 100644 --- a/kernel/src/filesystem/mount_table.cpp +++ b/kernel/src/filesystem/mount_table.cpp @@ -30,7 +30,6 @@ 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 auto mount_it = find_mount_iterator(path); if (mount_it == m_mounts.end()) { @@ -38,6 +37,10 @@ namespace kernel::filesystem } auto const & mount = *mount_it; + if (!mount->is_ready_to_unmount()) + { + return operation_result::cannot_be_unmounted; + } if (has_child_mounts(mount)) { return operation_result::has_child_mounts; |
