Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>

We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace!
This was a slightly tedious refactoring that took a long time, so it's
not unlikely that some bugs crept in.

Nevertheless, it does pass basic functionality testing, and it's just
real nice to finally see the same pattern in all contexts. :^)
This commit is contained in:
Andreas Kling 2021-11-08 00:51:39 +01:00
commit 79fa9765ca
Notes: sideshowbarker 2024-07-18 01:23:06 +09:00
262 changed files with 2415 additions and 2600 deletions

View file

@ -9,7 +9,7 @@
namespace Kernel::Memory {
KResultOr<NonnullRefPtr<SharedInodeVMObject>> SharedInodeVMObject::try_create_with_inode(Inode& inode)
ErrorOr<NonnullRefPtr<SharedInodeVMObject>> SharedInodeVMObject::try_create_with_inode(Inode& inode)
{
size_t size = inode.size();
if (auto shared_vmobject = inode.shared_vmobject())
@ -19,7 +19,7 @@ KResultOr<NonnullRefPtr<SharedInodeVMObject>> SharedInodeVMObject::try_create_wi
return vmobject;
}
KResultOr<NonnullRefPtr<VMObject>> SharedInodeVMObject::try_clone()
ErrorOr<NonnullRefPtr<VMObject>> SharedInodeVMObject::try_clone()
{
return adopt_nonnull_ref_or_enomem<VMObject>(new (nothrow) SharedInodeVMObject(*this));
}