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

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
7 changed files with 61 additions and 74 deletions

View file

@ -37,20 +37,6 @@ FileSystem* FileSystem::fromID(dword id)
return nullptr;
}
String FileSystem::name_of_child_in_directory(InodeIdentifier parent, InodeIdentifier child) const
{
String name;
bool success = enumerateDirectoryInode(parent, [&] (auto& entry) {
if (entry.inode == child) {
name = entry.name;
return false;
}
return true;
});
ASSERT(success);
return name;
}
ByteBuffer CoreInode::read_entire(FileDescriptor* descriptor)
{
return fs().readEntireInode(identifier(), descriptor);