1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

Kernel: Make FileSystem::get_inode() return KResultOr<NRP<Inode>>

This allows for natural error propagation in a bunch of new places.
This commit is contained in:
Andreas Kling 2021-09-05 18:55:55 +02:00
parent 12d9a6c1fa
commit caaeae9607
8 changed files with 33 additions and 49 deletions

View file

@ -65,7 +65,7 @@ Inode& DevFS::root_inode()
return *m_root_inode;
}
RefPtr<Inode> DevFS::get_inode(InodeIdentifier inode_id) const
KResultOr<NonnullRefPtr<Inode>> DevFS::get_inode(InodeIdentifier inode_id) const
{
MutexLocker locker(m_lock);
if (inode_id.index() == 1)
@ -74,7 +74,7 @@ RefPtr<Inode> DevFS::get_inode(InodeIdentifier inode_id) const
if (inode_id.index() == node.index())
return node;
}
return nullptr;
return ENOENT;
}
DevFSInode::DevFSInode(DevFS& fs)