Refactor FS::find_parent_of_inode() into Inode::parent().

This way, Ext2FSInode can cache its parent inode index. This makes absolute
path lookups dramatically faster.
SynthFSInode is also simplified greatly.
This commit is contained in:
Andreas Kling 2019-01-04 18:37:58 +01:00
parent 7731aef7b2
commit 0d36281162
Notes: sideshowbarker 2024-07-19 16:06:06 +09:00
6 changed files with 28 additions and 21 deletions

View file

@ -346,7 +346,7 @@ String VFS::absolute_path(Inode& core_inode)
if (inode->is_directory()) {
parent_id = resolve_path("..", inode->identifier(), error);
} else {
parent_id = inode->fs().find_parent_of_inode(inode->identifier());
parent_id = inode->parent()->identifier();
}
ASSERT(parent_id.is_valid());
inode = get_inode(parent_id);