diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-08 00:51:39 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-08 01:10:53 +0100 |
commit | 79fa9765ca89869d19364143989436d117974c21 (patch) | |
tree | 3af62f70127d9217d841047f6b7461351800d1ae /Kernel/Storage/StorageDevice.cpp | |
parent | 7ee10c69264cb278845a1e1b06d5acf2e5e7ddf0 (diff) | |
download | serenity-79fa9765ca89869d19364143989436d117974c21.zip |
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. :^)
Diffstat (limited to 'Kernel/Storage/StorageDevice.cpp')
-rw-r--r-- | Kernel/Storage/StorageDevice.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Storage/StorageDevice.cpp b/Kernel/Storage/StorageDevice.cpp index 81020f01b5..1310d57f3f 100644 --- a/Kernel/Storage/StorageDevice.cpp +++ b/Kernel/Storage/StorageDevice.cpp @@ -26,7 +26,7 @@ StringView StorageDevice::class_name() const return "StorageDevice"sv; } -KResultOr<size_t> StorageDevice::read(OpenFileDescription&, u64 offset, UserOrKernelBuffer& outbuf, size_t len) +ErrorOr<size_t> StorageDevice::read(OpenFileDescription&, u64 offset, UserOrKernelBuffer& outbuf, size_t len) { unsigned index = offset / block_size(); u16 whole_blocks = len / block_size(); @@ -93,7 +93,7 @@ bool StorageDevice::can_read(const OpenFileDescription&, size_t offset) const return offset < (max_addressable_block() * block_size()); } -KResultOr<size_t> StorageDevice::write(OpenFileDescription&, u64 offset, const UserOrKernelBuffer& inbuf, size_t len) +ErrorOr<size_t> StorageDevice::write(OpenFileDescription&, u64 offset, const UserOrKernelBuffer& inbuf, size_t len) { unsigned index = offset / block_size(); u16 whole_blocks = len / block_size(); @@ -188,7 +188,7 @@ bool StorageDevice::can_write(const OpenFileDescription&, size_t offset) const return offset < (max_addressable_block() * block_size()); } -KResult StorageDevice::ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) +ErrorOr<void> StorageDevice::ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) { switch (request) { case STORAGE_DEVICE_GET_SIZE: { |