Kernel: Ext2 inodes are now stored in cache

This allows faster inode access and ensures working inodes when
opened in multiple places.
This commit is contained in:
Bananymous
2023-09-25 20:31:40 +03:00
parent ef68e12125
commit 9d55cf1d80
2 changed files with 13 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <BAN/HashMap.h>
#include <kernel/Storage/StorageDevice.h>
#include <kernel/FS/FileSystem.h>
#include <kernel/FS/Ext2/Inode.h>
@@ -65,6 +66,8 @@ namespace Kernel
BAN::ErrorOr<uint32_t> reserve_free_block(uint32_t primary_bgd);
BAN::HashMap<ino_t, BAN::RefPtr<Inode>>& inode_cache() { return m_inode_cache; }
const Ext2::Superblock& superblock() const { return m_superblock; }
struct BlockLocation
@@ -104,6 +107,8 @@ namespace Kernel
BAN::RefPtr<Inode> m_root_inode;
BAN::Vector<uint32_t> m_superblock_backups;
BAN::HashMap<ino_t, BAN::RefPtr<Inode>> m_inode_cache;
BlockBufferManager m_buffer_manager;
Ext2::Superblock m_superblock;