kernel: Add functionality to allow external inodes (such as sockets) to acquire an inode number from a file system
This is only implemented in tmpfs.
This commit is contained in:
parent
c1d08b904e
commit
c4e30c3029
@ -35,6 +35,11 @@ namespace VFS
|
|||||||
|
|
||||||
virtual Result<SharedPtr<Inode>> create_symlink_inode(StringView link) = 0;
|
virtual Result<SharedPtr<Inode>> create_symlink_inode(StringView link) = 0;
|
||||||
|
|
||||||
|
virtual Result<u64> allocate_inode_number()
|
||||||
|
{
|
||||||
|
return err(ENOTSUP);
|
||||||
|
}
|
||||||
|
|
||||||
virtual Result<void> set_mount_dir(SharedPtr<Inode> parent) = 0;
|
virtual Result<void> set_mount_dir(SharedPtr<Inode> parent) = 0;
|
||||||
|
|
||||||
virtual Result<void> reset_mount_dir() = 0;
|
virtual Result<void> reset_mount_dir() = 0;
|
||||||
|
@ -16,6 +16,11 @@ namespace TmpFS
|
|||||||
return (SharedPtr<VFS::FileSystem>)fs;
|
return (SharedPtr<VFS::FileSystem>)fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result<u64> FileSystem::allocate_inode_number()
|
||||||
|
{
|
||||||
|
return m_next_inode_number++;
|
||||||
|
}
|
||||||
|
|
||||||
Result<SharedPtr<VFS::Inode>> FileSystem::create_file_inode()
|
Result<SharedPtr<VFS::Inode>> FileSystem::create_file_inode()
|
||||||
{
|
{
|
||||||
SharedPtr<FileInode> inode = TRY(make_shared<FileInode>());
|
SharedPtr<FileInode> inode = TRY(make_shared<FileInode>());
|
||||||
|
@ -18,6 +18,8 @@ namespace TmpFS
|
|||||||
Result<SharedPtr<VFS::Inode>> create_device_inode(u32 major, u32 minor) override;
|
Result<SharedPtr<VFS::Inode>> create_device_inode(u32 major, u32 minor) override;
|
||||||
Result<SharedPtr<VFS::Inode>> create_symlink_inode(StringView link) override;
|
Result<SharedPtr<VFS::Inode>> create_symlink_inode(StringView link) override;
|
||||||
|
|
||||||
|
Result<u64> allocate_inode_number() override;
|
||||||
|
|
||||||
Result<void> set_mount_dir(SharedPtr<VFS::Inode> parent) override;
|
Result<void> set_mount_dir(SharedPtr<VFS::Inode> parent) override;
|
||||||
|
|
||||||
Result<void> reset_mount_dir() override;
|
Result<void> reset_mount_dir() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user