#include "fs/ext2/FileSystem.h" namespace Ext2 { FileSystem::FileSystem() { } Result> FileSystem::find_inode_by_number(ino_t inode) { auto maybe_inode = m_inode_cache.try_get(inode); if (maybe_inode.has_value()) return maybe_inode.value(); // TODO: Locate the inode's block group descriptor and find it in the block group's inode table. return err(ENOENT); } Result> FileSystem::create(SharedPtr host_device) { SharedPtr fs = TRY(adopt_shared_if_nonnull(new (std::nothrow) FileSystem())); const usize nread = TRY(host_device->read((u8*)&fs->m_superblock, 1024, 1024)); if (nread != 1024) return err(EINVAL); // Source had an invalid superblock. if (fs->m_superblock.signature != EXT2_MAGIC) return err(EINVAL); // Source had an invalid superblock. // TODO: Implement basic Ext2 reading, enough to be able to mount a volume. return err(ENOTSUP); } }