Repository: SerenityOS/serenity
File: Kernel/FileSystem/FATFS/Inode.h (C/C++)

Code before:
    ErrorOr<Vector<ByteBuffer>> collect_sfns();

    enum class FreeClusters {
        Yes,
        No,
    };

    ErrorOr<void> remove_child_impl(StringView name, FreeClusters free_clusters);

    // ^Inode
    virtual ErrorOr<size_t> write_bytes_locked(off_t, size_t, UserOrKernelBuffer const& data, OpenFileDescription*) override;
    virtual ErrorOr<size_t> read_bytes_locked(off_t, size_t, UserOrKernelBuffer& buffer, OpenFileDescription*) const override;

    virtual InodeMetadata metadata() const override;
    virtual ErrorOr<void> traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override;
    virtual ErrorOr<NonnullRefPtr<Inode>> lookup(StringView name) override;
    virtual ErrorOr<NonnullRefPtr<Inode>> create_child(StringView name, mode_t, dev_t, UserID, GroupID) override;
    virtual ErrorOr<void> add_child(Inode&, StringView name, mode_t) override;
    virtual ErrorOr<void> remove_child(StringView name) override;
    virtual ErrorOr<void> chmod(mode_t) override;
    virtual ErrorOr<void> chown(UserID, GroupID) override;
    virtual ErrorOr<void> truncate_locked(u64) override;
    virtual ErrorOr<void> flush_metadata() override;
    virtual ErrorOr<void> update_timestamps(Optional<UnixDateTime> atime, Optional<UnixDateTime> ctime, Optional<UnixDateTime> mtime) override;

    OwnPtr<Vector<u32>> m_cluster_list;
    FATEntry m_entry;
    FATEntryLocation m_inode_metadata_location;
    NonnullOwnPtr<KString> m_filename;
};

}


Review comment (suggestion):
An `OwnPtr` of `Vector` is a bit weird. This should probably just be wrapped in an `Optional` instead.

Code after:
    ErrorOr<Vector<ByteBuffer>> collect_sfns();

    enum class FreeClusters {
        Yes,
        No,
    };

    ErrorOr<void> remove_child_impl(StringView name, FreeClusters free_clusters);

    // ^Inode
    virtual ErrorOr<size_t> write_bytes_locked(off_t, size_t, UserOrKernelBuffer const& data, OpenFileDescription*) override;
    virtual ErrorOr<size_t> read_bytes_locked(off_t, size_t, UserOrKernelBuffer& buffer, OpenFileDescription*) const override;

    virtual InodeMetadata metadata() const override;
    virtual ErrorOr<void> traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override;
    virtual ErrorOr<NonnullRefPtr<Inode>> lookup(StringView name) override;
    virtual ErrorOr<NonnullRefPtr<Inode>> create_child(StringView name, mode_t, dev_t, UserID, GroupID) override;
    virtual ErrorOr<void> add_child(Inode&, StringView name, mode_t) override;
    virtual ErrorOr<void> remove_child(StringView name) override;
    virtual ErrorOr<void> chmod(mode_t) override;
    virtual ErrorOr<void> chown(UserID, GroupID) override;
    virtual ErrorOr<void> truncate_locked(u64) override;
    virtual ErrorOr<void> flush_metadata() override;
    virtual ErrorOr<void> update_timestamps(Optional<UnixDateTime> atime, Optional<UnixDateTime> ctime, Optional<UnixDateTime> mtime) override;

    Optional<Vector<u32>> m_cluster_list;
    FATEntry m_entry;
    FATEntryLocation m_inode_metadata_location;
    NonnullOwnPtr<KString> m_filename;
};

}