Kernel: Implement relative file searching in VFS

This commit is contained in:
2024-09-14 19:43:44 +03:00
parent dce2436b2c
commit 6060b39548
2 changed files with 72 additions and 59 deletions

View File

@@ -27,7 +27,12 @@ namespace Kernel
BAN::RefPtr<Inode> inode;
BAN::String canonical_path;
};
BAN::ErrorOr<File> file_from_absolute_path(const Credentials&, BAN::StringView, int);
BAN::ErrorOr<File> file_from_relative_path(const File& parent, const Credentials&, BAN::StringView, int);
BAN::ErrorOr<File> file_from_absolute_path(const Credentials& credentials, BAN::StringView path, int flags)
{
return file_from_relative_path({ .inode = root_inode(), .canonical_path = {} }, credentials, path, flags);
}
private:
VirtualFileSystem() = default;