mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 07:18:51 +00:00
Add CoreInode::lookup() for directory lookups.
Also add a name-to-inode lookup cache to Ext2Inode. This seems like a great speedup for filesystem traversal.
This commit is contained in:
parent
8fa2d7104a
commit
5f434bc00b
Notes:
sideshowbarker
2024-07-19 16:10:32 +09:00
Author: https://github.com/awesomekling
Commit: 5f434bc00b
7 changed files with 48 additions and 18 deletions
|
@ -525,7 +525,8 @@ InodeIdentifier VFS::resolve_path(const String& path, int& error, InodeIdentifie
|
|||
return { };
|
||||
}
|
||||
auto parent = crumb_id;
|
||||
crumb_id = crumb_id.fileSystem()->child_of_directory_inode_with_name(crumb_id, part);
|
||||
auto dir_inode = get_inode(crumb_id);
|
||||
crumb_id = dir_inode->lookup(part);
|
||||
if (!crumb_id.isValid()) {
|
||||
#ifdef VFS_DEBUG
|
||||
kprintf("child <%s>(%u) not found in directory, %02u:%08u\n", part.characters(), part.length(), parent.fsid(), parent.index());
|
||||
|
@ -547,8 +548,8 @@ InodeIdentifier VFS::resolve_path(const String& path, int& error, InodeIdentifie
|
|||
kprintf(" -- is guest\n");
|
||||
#endif
|
||||
auto mount = find_mount_for_guest(crumb_id);
|
||||
crumb_id = mount->host();
|
||||
crumb_id = crumb_id.fileSystem()->child_of_directory_inode_with_name(crumb_id, "..");
|
||||
auto dir_inode = get_inode(mount->host());
|
||||
crumb_id = dir_inode->lookup("..");
|
||||
}
|
||||
metadata = crumb_id.metadata();
|
||||
if (metadata.isSymbolicLink()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue