kernel: Rename FileSystem::root() to root_inode() and add a shortcut for the root filesystem's root inode
This commit is contained in:
parent
ddc4692671
commit
6daad7787a
@ -3,4 +3,9 @@
|
|||||||
namespace VFS
|
namespace VFS
|
||||||
{
|
{
|
||||||
SharedPtr<FileSystem> root_fs;
|
SharedPtr<FileSystem> root_fs;
|
||||||
|
|
||||||
|
Inode& root_inode()
|
||||||
|
{
|
||||||
|
return root_fs->root_inode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ namespace VFS
|
|||||||
class FileSystem
|
class FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual Inode& root() const = 0;
|
virtual Inode& root_inode() const = 0;
|
||||||
|
|
||||||
virtual Result<SharedPtr<Inode>> create_file_inode() = 0;
|
virtual Result<SharedPtr<Inode>> create_file_inode() = 0;
|
||||||
|
|
||||||
@ -54,4 +54,6 @@ namespace VFS
|
|||||||
extern SharedPtr<FileSystem> root_fs;
|
extern SharedPtr<FileSystem> root_fs;
|
||||||
|
|
||||||
Result<Inode*> resolve_path(const char* path);
|
Result<Inode*> resolve_path(const char* path);
|
||||||
|
|
||||||
|
Inode& root_inode();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace TmpFS
|
|||||||
class FileSystem : public VFS::FileSystem
|
class FileSystem : public VFS::FileSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VFS::Inode& root() const override
|
VFS::Inode& root_inode() const override
|
||||||
{
|
{
|
||||||
return *m_root_inode;
|
return *m_root_inode;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ Result<void> init()
|
|||||||
|
|
||||||
VFS::root_fs = TRY(TmpFS::FileSystem::create());
|
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());
|
kinfoln("root inode number: %zu", root_inode.inode_number());
|
||||||
|
|
||||||
TarStream::Entry entry;
|
TarStream::Entry entry;
|
||||||
|
Loading…
Reference in New Issue
Block a user