mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Kernel/SysFS: Add Symbolic link functionality to the filesystem
This will be used later on to help connecting a node at /sys/dev/block/ that represents a Storage device to a directory in /sys/devices/storage/ with details on that device in that directory.
This commit is contained in:
parent
7e88bbe550
commit
ecc29bb52e
4 changed files with 104 additions and 0 deletions
|
@ -56,6 +56,20 @@ private:
|
|||
InodeIndex m_component_index {};
|
||||
};
|
||||
|
||||
class SysFSSymbolicLink : public SysFSComponent {
|
||||
public:
|
||||
virtual ErrorOr<size_t> read_bytes(off_t, size_t, UserOrKernelBuffer&, OpenFileDescription*) const override final;
|
||||
virtual ErrorOr<NonnullRefPtr<SysFSInode>> to_inode(SysFS const& sysfs_instance) const override final;
|
||||
|
||||
protected:
|
||||
ErrorOr<NonnullOwnPtr<KString>> try_generate_return_path_to_mount_point() const;
|
||||
ErrorOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const;
|
||||
|
||||
explicit SysFSSymbolicLink(SysFSDirectory const& parent_directory, SysFSComponent const& pointed_component);
|
||||
|
||||
RefPtr<SysFSComponent> m_pointed_component;
|
||||
};
|
||||
|
||||
class SysFSDirectory : public SysFSComponent {
|
||||
public:
|
||||
virtual ErrorOr<void> traverse_as_directory(FileSystemID, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue