#include "fs/VFS.h" #include "Log.h" #include namespace VFS { SharedPtr root_fs; Inode& root_inode() { return *root_fs->root_inode(); } Result> resolve_path(const char* path) { auto parser = TRY(PathParser::create(path)); kdbgln("vfs: trying to resolve path %s", path); SharedPtr current_inode; if (parser.is_absolute()) { current_inode = root_fs->root_inode(); } else { kwarnln("vfs: cannot resolve path '%s', as relative paths are not supported yet", path); return err(ENOTSUP); } const char* section; while (parser.next().try_set_value(section)) { kdbgln("vfs: searching for entry '%s' in inode %zu", section, current_inode->inode_number()); current_inode = TRY(current_inode->find(section)); } return current_inode; } }