1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:15:07 +00:00

Kernel: Make FileSystem::initialize() return KResult

This forced me to also come up with error codes for a bunch of
situations where we'd previously just panic the kernel.
This commit is contained in:
Andreas Kling 2021-08-14 14:02:47 +02:00
parent 46b93174fc
commit d30d776ca4
21 changed files with 61 additions and 58 deletions

View file

@ -195,7 +195,7 @@ private:
bool m_have_been_built { false };
};
bool Plan9FS::initialize()
KResult Plan9FS::initialize()
{
ensure_thread();
@ -204,7 +204,7 @@ bool Plan9FS::initialize()
auto result = post_message_and_wait_for_a_reply(version_message);
if (result.is_error())
return false;
return result;
u32 msize;
StringView remote_protocol_version;
@ -227,11 +227,13 @@ bool Plan9FS::initialize()
result = post_message_and_wait_for_a_reply(attach_message);
if (result.is_error()) {
dbgln("Attaching failed");
return false;
return result;
}
m_root_inode = Plan9FSInode::create(*this, root_fid);
return true;
if (!m_root_inode)
return ENOMEM;
return KSuccess;
}
Plan9FS::ProtocolVersion Plan9FS::parse_protocol_version(const StringView& s) const