2023-07-06 09:39:17 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <glacier/container/vector.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "fs/ext2/ext2_block_reader.h"
|
|
|
|
|
|
|
|
class InodeTable {
|
|
|
|
public:
|
2023-08-01 10:39:26 -07:00
|
|
|
InodeTable(const glcr::SharedPtr<Ext2BlockReader>& driver,
|
|
|
|
BlockGroupDescriptor* bgdt);
|
2023-07-06 09:39:17 -07:00
|
|
|
|
2023-08-01 10:39:26 -07:00
|
|
|
glcr::ErrorOr<Inode*> GetInode(uint32_t inode_num);
|
2023-07-06 09:39:17 -07:00
|
|
|
|
|
|
|
private:
|
2023-08-01 10:39:26 -07:00
|
|
|
glcr::SharedPtr<Ext2BlockReader> ext2_reader_;
|
2023-07-06 09:39:17 -07:00
|
|
|
BlockGroupDescriptor* bgdt_;
|
|
|
|
|
|
|
|
glcr::Vector<MappedMemoryRegion> inode_tables_;
|
|
|
|
|
|
|
|
glcr::ErrorOr<Inode*> GetRootOfInodeTable(uint64_t block_group_num);
|
|
|
|
};
|