[Kernel/VFS] Specify root entry to open from + cleanup.

[VFS] Allow specifying root entry to open from with OpenFile.
[Kernel] NtCreateFile now opens from root entry when available instead
         of needlessly building a full path and resolving from that.
[VFS] Reduce code duplication by adding Entry::ResolvePath.
[VFS] Remove ResolveBasePath to avoid multiple calls to find_base_guest_path.
This commit is contained in:
gibbed
2020-04-20 00:44:19 -05:00
committed by Rick Gibbed
parent 725f3ce17f
commit 1c2d6753bb
9 changed files with 33 additions and 60 deletions

View File

@@ -263,8 +263,8 @@ object_ref<XFile> XFile::Restore(KernelState* kernel_state,
vfs::File* vfs_file = nullptr;
vfs::FileAction action;
auto res = kernel_state->file_system()->OpenFile(
abs_path, vfs::FileDisposition::kOpen, access, is_directory, &vfs_file,
&action);
nullptr, abs_path, vfs::FileDisposition::kOpen, access, is_directory,
&vfs_file, &action);
if (XFAILED(res)) {
XELOGE("Failed to open XFile: error {:08X}", res);
return object_ref<XFile>(file);