summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/Ext2FileSystem.h
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-01 14:29:39 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-02 13:27:37 +0200
commit234c6ae32d5432bdf836e510fc67756ff750c295 (patch)
tree03cf2a2738ee8666585feb9c86435d1c2a8e8f54 /Kernel/FileSystem/Ext2FileSystem.h
parentde9b454f897aee3d7b1cd1a8235a40360da5425f (diff)
downloadserenity-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/Ext2FileSystem.h')
-rw-r--r--Kernel/FileSystem/Ext2FileSystem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/Ext2FileSystem.h b/Kernel/FileSystem/Ext2FileSystem.h
index 25b55c9f87..6e666a4137 100644
--- a/Kernel/FileSystem/Ext2FileSystem.h
+++ b/Kernel/FileSystem/Ext2FileSystem.h
@@ -38,12 +38,12 @@ public:
private:
// ^Inode
- virtual ssize_t read_bytes(off_t, ssize_t, UserOrKernelBuffer& buffer, FileDescription*) const override;
+ virtual KResultOr<ssize_t> read_bytes(off_t, ssize_t, UserOrKernelBuffer& buffer, FileDescription*) const override;
virtual InodeMetadata metadata() const override;
virtual KResult traverse_as_directory(Function<bool(const FS::DirectoryEntryView&)>) const override;
virtual RefPtr<Inode> lookup(StringView name) override;
virtual void flush_metadata() override;
- virtual ssize_t write_bytes(off_t, ssize_t, const UserOrKernelBuffer& data, FileDescription*) override;
+ virtual KResultOr<ssize_t> write_bytes(off_t, ssize_t, const UserOrKernelBuffer& data, FileDescription*) override;
virtual KResultOr<NonnullRefPtr<Inode>> create_child(const String& name, mode_t, dev_t, uid_t, gid_t) override;
virtual KResult add_child(Inode& child, const StringView& name, mode_t) override;
virtual KResult remove_child(const StringView& name) override;