8000 cmount: add support for fuse3 by jfantinhardesty · Pull Request #8579 · rclone/rclone · GitHub
[go: up one dir, main page]

Skip to content

cmount: add support for fuse3 #8579

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jfantinhardesty
Copy link

What is the purpose of this change?

Adds support for fuse3 to the cmount command on Linux and NetBSD based on the recent release from cgofuse https://github.com/winfsp/cgofuse/releases/tag/v1.6.0. This is done by using the fuse3 build tag which cgofuse uses to link to libfuse3. To build rclone with fuse3 you now can do go build -tags=cmount,fuse3

Was the change discussed in an issue or in the forum before?

(#6632)

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

Copy link
Member
@ncw ncw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this :-)

I don't like the duplicated mountOption function though.

I'd suggest you set constant in your two fuse3 and !fuse3 file say isFuse3 and then use this to select what to do in mountOptions in mount.go. A compile time constant will be completely optimized by the compiler so this is nice and efficient and will be easier to maintain I think.

What do you think?

@jfantinhardesty
Copy link
Author

Great suggestion, that is a lot cleaner. I made those changes so it should be easier to read now.

options = append(options, "-o", fmt.Sprintf("daemon_timeout=%d", int(time.Duration(opt.DaemonTimeout).Seconds())))
// The following options are not supported by fuse3
if !isFuse3 {
options = append(options, "-o", fmt.Sprintf("max_readahead=%d", opt.MaxReadAhead))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8000

This seems like it should be set in the init response but I don't see any way to set those for cgofuse. Same with maxwrite, which we default to 1MB for mount2, but skip here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that a change would need to be added to cgofuse since in fuse3 these options can no longer be specified on the command line.

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.

363F
3 participants
0