diff --git a/kernel/src/fs/VFS.h b/kernel/src/fs/VFS.h index ac014cd8..f09c89e2 100644 --- a/kernel/src/fs/VFS.h +++ b/kernel/src/fs/VFS.h @@ -35,6 +35,11 @@ namespace VFS virtual Result> create_symlink_inode(StringView link) = 0; + virtual Result allocate_inode_number() + { + return err(ENOTSUP); + } + virtual Result set_mount_dir(SharedPtr parent) = 0; virtual Result reset_mount_dir() = 0; diff --git a/kernel/src/fs/tmpfs/FileSystem.cpp b/kernel/src/fs/tmpfs/FileSystem.cpp index e871e2b5..71d0488c 100644 --- a/kernel/src/fs/tmpfs/FileSystem.cpp +++ b/kernel/src/fs/tmpfs/FileSystem.cpp @@ -16,6 +16,11 @@ namespace TmpFS return (SharedPtr)fs; } + Result FileSystem::allocate_inode_number() + { + return m_next_inode_number++; + } + Result> FileSystem::create_file_inode() { SharedPtr inode = TRY(make_shared()); diff --git a/kernel/src/fs/tmpfs/FileSystem.h b/kernel/src/fs/tmpfs/FileSystem.h index 2542c740..2d598a9c 100644 --- a/kernel/src/fs/tmpfs/FileSystem.h +++ b/kernel/src/fs/tmpfs/FileSystem.h @@ -18,6 +18,8 @@ namespace TmpFS Result> create_device_inode(u32 major, u32 minor) override; Result> create_symlink_inode(StringView link) override; + Result allocate_inode_number() override; + Result set_mount_dir(SharedPtr parent) override; Result reset_mount_dir() override;