-
Notifications
You must be signed in to change notification settings - Fork 117
feat: Propagate O_DIRECT flag in OpenFileOp and CreateFileOp #184
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geertj
reviewed
Nov 19, 2025
Contributor
geertj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Anushka. I have added some comments for your consideration.
geertj
approved these changes
Nov 20, 2025
Contributor
|
@stapelberg from my perspective these are ready to merge |
stapelberg
requested changes
Nov 20, 2025
stapelberg
approved these changes
Nov 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change identifies and propagates the O_DIRECT flag from file open and create operations to the FUSE server. This allows filesystems implemented with this library to be aware of when a user wants to use direct I/O for both new and existing files, which bypasses the kernel's page cache.
The changes in this pull request include:
internal/fusekernel/fuse_kernel_linux.go: Defines the OpenDirect flag and a helper function IsDirect().internal/fusekernel/fuse_kernel_darwin.go: Deprecation of unused methodSince O_DIRECT is not supported on macOS, this file provides a no-op implementation for Darwin builds. It defines OpenDirect as 0 and an IsDirect() method that always returns false . This is necessary to ensure the library compiles on non-Linux platforms while maintaining a consistent and stable API.fuseops/ops.go: Adds the OpenFlags field to the CreateFileOp struct to carry the open flags as already present in OpenFileOp.conversions.go: Passes the OpenFlags from the incoming FUSE message to the CreateFileOp during conversion as already done in OpenFileOp.Motivation:
GCSFuse wants to exercise granular control over operations on file handle open with O_DIRECT mode for which we need fuse to propagate the mode explicitly via the OpenFileOp and CreateFileOp so that file handle creation via GCSFuse is done with this information in context.