diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-06-01 20:10:57 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-06-02 16:30:20 +0200 |
| commit | 568e9586c036fc319fc36b12495e5deacb167be9 (patch) | |
| tree | ac8b1d631d74fb2aa321e0d868689eeb313ab7b7 | |
| parent | 86170be29f6cb72b29865db0975de09bec89f854 (diff) | |
| download | kernel-568e9586c036fc319fc36b12495e5deacb167be9.tar.xz kernel-568e9586c036fc319fc36b12495e5deacb167be9.zip | |
kernel/vfs: simplify initialization
| -rw-r--r-- | kernel/include/kernel/filesystem/vfs.hpp | 5 | ||||
| -rw-r--r-- | kernel/src/filesystem/vfs.cpp | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/kernel/include/kernel/filesystem/vfs.hpp b/kernel/include/kernel/filesystem/vfs.hpp index e6f2327..bbafa4f 100644 --- a/kernel/include/kernel/filesystem/vfs.hpp +++ b/kernel/include/kernel/filesystem/vfs.hpp @@ -35,6 +35,8 @@ namespace kernel::filesystem invalid_filesystem = -5 }; + vfs(); + /** @brief Initialize the virtual filesystem. @warning Panics if the VFS has already been initialized. @@ -83,9 +85,6 @@ namespace kernel::filesystem auto unmount(std::string_view path) -> operation_result; private: - vfs() = default; - auto init_internal() -> void; - /** * Note: Resolving a dentry requires traversing mount points; since the * associated 'mount' object is discovered as a byproduct of this diff --git a/kernel/src/filesystem/vfs.cpp b/kernel/src/filesystem/vfs.cpp index c297210..91afc13 100644 --- a/kernel/src/filesystem/vfs.cpp +++ b/kernel/src/filesystem/vfs.cpp @@ -45,12 +45,12 @@ namespace kernel::filesystem kapi::system::panic("[FILESYSTEM] vfs has already been initialized."); } - active_vfs.emplace(vfs{}); - active_vfs->init_internal(); + active_vfs.emplace(); } - auto vfs::init_internal() -> void + vfs::vfs() { + // Register all compiled-in filesystems auto type_descriptors = std::span{&__start_vfs_type_descriptors, &__stop_vfs_type_descriptors} | std::views::filter([](auto p) { return p != nullptr; }); std::ranges::for_each(type_descriptors, [](auto descriptor) { |
