#include "filesystem/vfs.hpp" #include "kapi/system.hpp" #include namespace filesystem { namespace { constinit auto static active_vfs = std::optional{}; } auto vfs::init() -> void { if (active_vfs) { kapi::system::panic("[FILESYSTEM] vfs has already been initialized."); } active_vfs.emplace(vfs{}); } auto vfs::get() -> vfs & { if (!active_vfs) { kapi::system::panic("[FILESYSTEM] vfs has not been initialized."); } return *active_vfs; } } // namespace filesystem