diff --git a/kernel/src/fs/VFS.cpp b/kernel/src/fs/VFS.cpp index dfa9b609..1da679c4 100644 --- a/kernel/src/fs/VFS.cpp +++ b/kernel/src/fs/VFS.cpp @@ -3,4 +3,9 @@ namespace VFS { SharedPtr root_fs; + + Inode& root_inode() + { + return root_fs->root_inode(); + } } diff --git a/kernel/src/fs/VFS.h b/kernel/src/fs/VFS.h index ac1ec564..78801006 100644 --- a/kernel/src/fs/VFS.h +++ b/kernel/src/fs/VFS.h @@ -44,7 +44,7 @@ namespace VFS class FileSystem { public: - virtual Inode& root() const = 0; + virtual Inode& root_inode() const = 0; virtual Result> create_file_inode() = 0; @@ -54,4 +54,6 @@ namespace VFS extern SharedPtr root_fs; Result resolve_path(const char* path); + + Inode& root_inode(); } diff --git a/kernel/src/fs/tmpfs/FileSystem.h b/kernel/src/fs/tmpfs/FileSystem.h index 75929143..77c012c1 100644 --- a/kernel/src/fs/tmpfs/FileSystem.h +++ b/kernel/src/fs/tmpfs/FileSystem.h @@ -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; } diff --git a/kernel/src/main.cpp b/kernel/src/main.cpp index f0c83f7b..b65c997d 100644 --- a/kernel/src/main.cpp +++ b/kernel/src/main.cpp @@ -58,7 +58,7 @@ Result 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;