1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

Kernel: Tidy up SysFS construction

- Use KResultOr and TRY() to propagate errors
- Check for OOM errors
- Move allocation out of constructors

There's still a lot more to do here, as SysFS is still quite brittle
in the face of memory pressure.
This commit is contained in:
Andreas Kling 2021-09-06 11:06:20 +02:00
parent 788b91a65c
commit 47bfbe343b
5 changed files with 19 additions and 19 deletions

View file

@ -85,7 +85,7 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
} else if (fs_type == "dev"sv || fs_type == "DevFS"sv) {
fs = TRY(DevFS::try_create());
} else if (fs_type == "sys"sv || fs_type == "SysFS"sv) {
fs = SysFS::create();
fs = TRY(SysFS::try_create());
} else if (fs_type == "tmp"sv || fs_type == "TmpFS"sv) {
fs = TRY(TmpFS::try_create());
} else if (fs_type == "iso9660"sv || fs_type == "ISO9660FS"sv) {