[Victoria Falls] Print only the root directory information.

Move the InodeTable creating to the Init function which (somewhat)
requires us to stop taking the Ext2BlockReader as a reference (the reference
from the Init function goes out of scope). Make the Ext2BlockReader Init
function return a shared ptr by default.
This commit is contained in:
Drew Galbraith 2023-08-01 10:39:26 -07:00
parent bed685af65
commit 083ed52ddd
7 changed files with 44 additions and 45 deletions

View file

@ -13,11 +13,14 @@ class Ext2Driver {
glcr::ErrorCode ProbePartition();
glcr::ErrorOr<Inode*> GetInode(uint32_t inode_number);
glcr::ErrorCode ProbeDirectory(Inode* inode);
private:
Ext2BlockReader ext2_reader_;
glcr::SharedPtr<Ext2BlockReader> ext2_reader_;
glcr::UniquePtr<InodeTable> inode_table_;
Ext2Driver(Ext2BlockReader&& reader) : ext2_reader_(glcr::Move(reader)) {}
Ext2Driver(const glcr::SharedPtr<Ext2BlockReader>& reader,
glcr::UniquePtr<InodeTable> inode_table)
: ext2_reader_(reader), inode_table_(glcr::Move(inode_table)) {}
};