Kernel: Optimize Ext2 disk reads
We used to read whole file until we reached the asked offset. Now we can calculate the appropriate block and read just the asked data.
This commit is contained in:
@@ -136,6 +136,8 @@ namespace Kernel
|
||||
virtual BAN::ErrorOr<BAN::RefPtr<Inode>> directory_find(BAN::StringView) override;
|
||||
|
||||
private:
|
||||
BAN::ErrorOr<uint32_t> data_block_index(uint32_t);
|
||||
|
||||
using block_callback_t = BAN::ErrorOr<bool>(*)(const BAN::Vector<uint8_t>&, void*);
|
||||
BAN::ErrorOr<void> for_each_block(block_callback_t, void*);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user