1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:35:07 +00:00

Revert "Kernel: Convert read_block method to get a reference instead of pointer"

This reverts commit 092a13211a.

Fixes #4611.
This commit is contained in:
Andreas Kling 2020-12-29 00:05:37 +01:00
parent 13594b7146
commit 43d9fe15f9
3 changed files with 47 additions and 80 deletions

View file

@ -27,22 +27,10 @@
#pragma once
#include <Kernel/FileSystem/FileBackedFileSystem.h>
#include <Kernel/KResult.h>
namespace Kernel {
class DiskCache;
class BlockBasedFS : public FileBackedFS {
friend class DiskCache;
private:
struct CacheEntry {
IntrusiveListNode list_node;
u32 block_index { 0 };
u8* data { nullptr };
bool has_data { false };
};
public:
virtual ~BlockBasedFS() override;
@ -54,10 +42,7 @@ public:
protected:
explicit BlockBasedFS(FileDescription&);
int read_block(unsigned index, UserOrKernelBuffer& buffer, size_t count, size_t offset = 0, bool allow_cache = true) const;
bool force_cache_block(unsigned index) const;
KResultOr<CacheEntry> cache_block(unsigned index) const;
int read_block(unsigned index, UserOrKernelBuffer* buffer, size_t count, size_t offset = 0, bool allow_cache = true) const;
int read_blocks(unsigned index, unsigned count, UserOrKernelBuffer& buffer, bool allow_cache = true) const;
bool raw_read(unsigned index, UserOrKernelBuffer& buffer);