1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +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

@ -121,9 +121,9 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
if (!fs)
return ENOMEM;
if (!fs->initialize()) {
if (auto result = fs->initialize(); result.is_error()) {
dbgln("mount: failed to initialize {} filesystem, fd={}", fs_type, source_fd);
return ENODEV;
return result;
}
auto result = VirtualFileSystem::the().mount(fs.release_nonnull(), target_custody, params.flags);