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

@ -6,11 +6,11 @@
#pragma once
#include <AK/Error.h>
#include <AK/IntrusiveList.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <Kernel/API/KResult.h>
#include <Kernel/Forward.h>
#include <Kernel/Heap/SlabAllocator.h>
#include <Kernel/KString.h>
@ -24,7 +24,7 @@ class Custody : public RefCountedBase {
public:
bool unref() const;
static KResultOr<NonnullRefPtr<Custody>> try_create(Custody* parent, StringView name, Inode&, int mount_flags);
static ErrorOr<NonnullRefPtr<Custody>> try_create(Custody* parent, StringView name, Inode&, int mount_flags);
~Custody();
@ -33,7 +33,7 @@ public:
Inode& inode() { return *m_inode; }
Inode const& inode() const { return *m_inode; }
StringView name() const { return m_name->view(); }
KResultOr<NonnullOwnPtr<KString>> try_serialize_absolute_path() const;
ErrorOr<NonnullOwnPtr<KString>> try_serialize_absolute_path() const;
String absolute_path() const;
int mount_flags() const { return m_mount_flags; }