1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +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

@ -183,8 +183,8 @@ NonnullRefPtr<FileSystem> StorageManagement::root_filesystem() const
PANIC("StorageManagement: Couldn't find a suitable device to boot from");
}
auto e2fs = Ext2FS::create(FileDescription::create(boot_device_description.release_nonnull()).value());
if (!e2fs->initialize()) {
PANIC("StorageManagement: Couldn't open root filesystem");
if (auto result = e2fs->initialize(); result.is_error()) {
PANIC("StorageManagement: Couldn't open root filesystem: {}", result);
}
return e2fs;
}