mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:47:35 +00:00
Kernel: Make DiskBackedFS::read_block() write to client-provided memory
Instead of having DiskBackedFS allocate a ByteBuffer, leave it to each client to provide buffer space. This is significantly faster in many cases where we can use a stack buffer and avoid heap allocation entirely.
This commit is contained in:
parent
a61f6ccc27
commit
1fc2612667
3 changed files with 49 additions and 34 deletions
|
@ -19,8 +19,8 @@ public:
|
|||
protected:
|
||||
explicit DiskBackedFS(NonnullRefPtr<DiskDevice>&&);
|
||||
|
||||
ByteBuffer read_block(unsigned index) const;
|
||||
ByteBuffer read_blocks(unsigned index, unsigned count) const;
|
||||
bool read_block(unsigned index, u8* buffer) const;
|
||||
bool read_blocks(unsigned index, unsigned count, u8* buffer) const;
|
||||
|
||||
bool write_block(unsigned index, const ByteBuffer&);
|
||||
bool write_blocks(unsigned index, unsigned count, const ByteBuffer&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue