Skip to content

Add vfs_get_file_size method to VFS subsystem#2

Open
reeze wants to merge 1 commit intomasterfrom
add-get-file-size
Open

Add vfs_get_file_size method to VFS subsystem#2
reeze wants to merge 1 commit intomasterfrom
add-get-file-size

Conversation

@reeze
Copy link
Copy Markdown
Owner

@reeze reeze commented May 28, 2024

Related to #1

Adds a new method vfs_get_file_size() to directly retrieve the size of a file in the VFS subsystem. This method enhances the accessibility of file size information, making it more efficient to obtain this data without navigating through file metadata structures.

  • Implements vfs_get_file_size() in fs/read_write.c, which returns the size of a file by reading the i_size attribute from the file's inode.
  • Exports the symbol vfs_get_file_size to make it accessible for use in other parts of the kernel.
  • Ensures error handling for invalid file descriptors or when the inode is not available, returning appropriate error codes in such cases.

For more details, open the Copilot Workspace session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant