diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-05-01 14:29:39 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-02 13:27:37 +0200 |
commit | 234c6ae32d5432bdf836e510fc67756ff750c295 (patch) | |
tree | 03cf2a2738ee8666585feb9c86435d1c2a8e8f54 /Kernel/FileSystem/Plan9FileSystem.h | |
parent | de9b454f897aee3d7b1cd1a8235a40360da5425f (diff) | |
download | serenity-234c6ae32d5432bdf836e510fc67756ff750c295.zip |
Kernel: Change Inode::{read/write}_bytes interface to KResultOr<ssize_t>
The error handling in all these cases was still using the old style
negative values to indicate errors. We have a nicer solution for this
now with KResultOr<T>. This change switches the interface and then all
implementers to use the new style.
Diffstat (limited to 'Kernel/FileSystem/Plan9FileSystem.h')
-rw-r--r-- | Kernel/FileSystem/Plan9FileSystem.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/Plan9FileSystem.h b/Kernel/FileSystem/Plan9FileSystem.h index 71a64b1062..dd654e668b 100644 --- a/Kernel/FileSystem/Plan9FileSystem.h +++ b/Kernel/FileSystem/Plan9FileSystem.h @@ -156,8 +156,8 @@ public: // ^Inode virtual InodeMetadata metadata() const override; virtual void flush_metadata() override; - virtual ssize_t read_bytes(off_t, ssize_t, UserOrKernelBuffer& buffer, FileDescription*) const override; - virtual ssize_t write_bytes(off_t, ssize_t, const UserOrKernelBuffer& data, FileDescription*) override; + virtual KResultOr<ssize_t> read_bytes(off_t, ssize_t, UserOrKernelBuffer& buffer, FileDescription*) const override; + virtual KResultOr<ssize_t> write_bytes(off_t, ssize_t, const UserOrKernelBuffer& data, FileDescription*) override; virtual KResult traverse_as_directory(Function<bool(const FS::DirectoryEntryView&)>) const override; virtual RefPtr<Inode> lookup(StringView name) override; virtual KResultOr<NonnullRefPtr<Inode>> create_child(const String& name, mode_t, dev_t, uid_t, gid_t) override; |