[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:
@@ -53,21 +53,8 @@ Entry* HostPathDevice::ResolvePath(const std::string_view path) {
|
||||
// The filesystem will have stripped our prefix off already, so the path will
|
||||
// be in the form:
|
||||
// some\PATH.foo
|
||||
|
||||
XELOGFS("HostPathDevice::ResolvePath({})", path);
|
||||
|
||||
// Walk the path, one separator at a time.
|
||||
auto entry = root_entry_.get();
|
||||
auto path_parts = xe::utf8::split_path(path);
|
||||
for (auto& part : path_parts) {
|
||||
entry = entry->GetChild(part);
|
||||
if (!entry) {
|
||||
// Not found.
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return entry;
|
||||
return root_entry_->ResolvePath(path);
|
||||
}
|
||||
|
||||
void HostPathDevice::PopulateEntry(HostPathEntry* parent_entry) {
|
||||
|
||||
Reference in New Issue
Block a user