Kernel: Ext2 filesystem now holds 10 preallocated block buffers

Inodes can query blocks from this buffer. This allows allocation of
blocks to not fail during normal operations. Also less stress on
kmalloc.
This commit is contained in:
2023-09-25 14:22:32 +03:00
parent 0e67c6318b
commit 669b2ace4e
4 changed files with 158 additions and 102 deletions

View File

@@ -39,7 +39,7 @@ namespace Kernel
virtual BAN::ErrorOr<void> truncate_impl(size_t) override;
private:
BAN::ErrorOr<uint32_t> fs_block_of_data_block_index(uint32_t data_block_index);
uint32_t fs_block_of_data_block_index(uint32_t data_block_index);
BAN::ErrorOr<uint32_t> allocate_new_block();
BAN::ErrorOr<void> sync();