Kernel: i386 has 14 indirect blocks in TmpInode instead of 2

This allows keeping size of TmpInodeInfo as 128
This commit is contained in:
Bananymous 2024-03-22 13:00:57 +02:00
parent c0dff5e203
commit 2352c86048
1 changed files with 11 additions and 0 deletions

View File

@ -21,12 +21,23 @@ namespace Kernel
size_t size { 0 };
blkcnt_t blocks { 0 };
#if ARCH(x86_64)
// 2x direct blocks
// 1x singly indirect
// 1x doubly indirect
// 1x triply indirect
BAN::Array<paddr_t, 5> block;
static constexpr size_t direct_block_count = 2;
#elif ARCH(i386)
// 14x direct blocks
// 1x singly indirect
// 1x doubly indirect
// 1x triply indirect
BAN::Array<paddr_t, 17> block;
static constexpr size_t direct_block_count = 14;
#else
#error
#endif
static constexpr size_t max_size =
direct_block_count * PAGE_SIZE +
(PAGE_SIZE / sizeof(paddr_t)) * PAGE_SIZE +