1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 09:24:57 +00:00

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
6 changed files with 28 additions and 21 deletions

View file

@ -158,12 +158,9 @@ auto SynthFS::generate_inode_index() -> InodeIndex
return m_next_inode_index++;
}
InodeIdentifier SynthFS::find_parent_of_inode(InodeIdentifier inode) const
RetainPtr<Inode> SynthFSInode::parent() const
{
auto it = m_inodes.find(inode.index());
if (it == m_inodes.end())
return { };
return (*it).value->m_parent;
return fs().get_inode(m_parent);
}
RetainPtr<Inode> SynthFS::get_inode(InodeIdentifier inode) const