Start working on a VFS implementation #22

Closed
apio wants to merge 44 commits from oop-vfs into main
2 changed files with 18 additions and 7 deletions
Showing only changes of commit 5edd316198 - Show all commits

View File

@ -20,7 +20,23 @@ namespace VFS
virtual ~Inode() = default; virtual ~Inode() = default;
InodeType type; virtual InodeType type() const = 0;
};
class FileInode : Inode
{
public:
Result<Inode*> find(const char*) const override
{
return err(ENOTDIR);
}
InodeType type() const override
{
return InodeType::RegularFile;
}
virtual ~FileInode() = default;
}; };
class FileSystem class FileSystem

View File

@ -26,18 +26,13 @@ namespace TmpFS
Vector<SharedPtr<VFS::Inode>> m_inodes; Vector<SharedPtr<VFS::Inode>> m_inodes;
}; };
class Inode : public VFS::Inode class Inode : public VFS::FileInode
{ {
public: public:
Inode(); Inode();
void set_fs(FileSystem& fs, Badge<FileSystem>); void set_fs(FileSystem& fs, Badge<FileSystem>);
Result<VFS::Inode*> find(const char*) const override
{
return err(ENOTSUP);
}
VFS::FileSystem& fs() const override VFS::FileSystem& fs() const override
{ {
return *m_fs; return *m_fs;