Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double data copy due to use of Bytes #9

Open
asomers opened this issue Sep 5, 2021 · 0 comments
Open

Double data copy due to use of Bytes #9

asomers opened this issue Sep 5, 2021 · 0 comments

Comments

@asomers
Copy link
Contributor

asomers commented Sep 5, 2021

The ReplyData and ReplyXAttr types use bytes::Bytes to pass data from the filesystem to fuse3. Because those methods are async fn, it makes sense that the buffer type must be 'static. However, using bytes::Bytes is unnecessarily restrictive. My file system does not use Bytes internally, so I must do a data copy from my own buffer type into a Bytes, only for fuse3 to immediately copy it again with Vec::extend_from_slice.
The extra data copy could be eliminated if Filesystem has a generic parameter type Buffer: AsRef<[u8]> + 'static, and the ReplyData and ReplyXAttr types use that instead of Bytes.

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

No branches or pull requests

1 participant