From 2352c8604846d32c69963e5ff5e07e6097913854 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 22 Mar 2024 13:00:57 +0200 Subject: [PATCH] Kernel: i386 has 14 indirect blocks in TmpInode instead of 2 This allows keeping size of TmpInodeInfo as 128 --- kernel/include/kernel/FS/TmpFS/Definitions.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/include/kernel/FS/TmpFS/Definitions.h b/kernel/include/kernel/FS/TmpFS/Definitions.h index 92543775..bfbe33d3 100644 --- a/kernel/include/kernel/FS/TmpFS/Definitions.h +++ b/kernel/include/kernel/FS/TmpFS/Definitions.h @@ -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 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 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 +