Add CoreInode::reverse_lookup().

Getting the absolute path of an ext2fs inode now uses the lookup cache
which makes it a lot faster.
This commit is contained in:
Andreas Kling 2018-11-15 17:04:55 +01:00
parent 5f434bc00b
commit eced5f11e3
Notes: sideshowbarker 2024-07-19 16:10:30 +09:00
7 changed files with 61 additions and 74 deletions

View file

@ -486,7 +486,8 @@ String VFS::absolute_path(CoreInode& core_inode)
if (auto* mount = find_mount_for_host(parent))
parent = mount->guest();
builder.append('/');
builder.append(parent.fileSystem()->name_of_child_in_directory(parent, child));
auto parent_inode = get_inode(parent);
builder.append(parent_inode->reverse_lookup(child));
}
return builder.build();
}