Start working on a VFS implementation #22

Closed
apio wants to merge 44 commits from oop-vfs into main
4 changed files with 10 additions and 3 deletions
Showing only changes of commit 6daad7787a - Show all commits

View File

@ -3,4 +3,9 @@
namespace VFS
{
SharedPtr<FileSystem> root_fs;
Inode& root_inode()
{
return root_fs->root_inode();
}
}

View File

@ -44,7 +44,7 @@ namespace VFS
class FileSystem
{
public:
virtual Inode& root() const = 0;
virtual Inode& root_inode() const = 0;
virtual Result<SharedPtr<Inode>> create_file_inode() = 0;
@ -54,4 +54,6 @@ namespace VFS
extern SharedPtr<FileSystem> root_fs;
Result<Inode*> resolve_path(const char* path);
Inode& root_inode();
}

View File

@ -8,7 +8,7 @@ namespace TmpFS
class FileSystem : public VFS::FileSystem
{
public:
VFS::Inode& root() const override
VFS::Inode& root_inode() const override
{
return *m_root_inode;
}

View File

@ -58,7 +58,7 @@ Result<void> init()
VFS::root_fs = TRY(TmpFS::FileSystem::create());
VFS::Inode& root_inode = VFS::root_fs->root();
VFS::Inode& root_inode = VFS::root_inode();
kinfoln("root inode number: %zu", root_inode.inode_number());
TarStream::Entry entry;