refactor(uffd): extract Prefault to its own file#2441
Merged
ValentaTomas merged 3 commits intomainfrom Apr 18, 2026
Merged
Conversation
Move Prefault and the directDataSource helper from userfaultfd.go into a dedicated prefault.go. Pure file move, no behavior change.
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 57ee84f. Bugbot is set up for automated code reviews on this repo. Configure here. |
This was referenced Apr 18, 2026
There was a problem hiding this comment.
LGTM — pure mechanical file move with no behavior changes.
Extended reasoning...
Overview\nThis PR moves the Prefault method and its directDataSource helper type verbatim from userfaultfd.go into a new prefault.go file. Two files are touched: the new file gains the moved code, and the old file has those lines deleted.\n\n### Security Risks\nNone. This is a pure refactor with no logic changes. No auth, crypto, or permission-sensitive code is involved.\n\n### Level of Scrutiny\nVery low. The diff is a clean cut-and-paste with no modifications to the moved code. The only identified issue is a pre-existing misleading error message ("less than" when the check is inequality), which has no functional impact and predates this PR.\n\n### Other Factors\nThe pre-existing error message nit is captured as an inline comment. It is minor (diagnostic text only, no runtime behavior change) and does not warrant blocking this refactor. Build and vet checks pass per the PR description.
djeebus
approved these changes
Apr 18, 2026
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
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.
Summary
Split out of #2419 to keep review surface minimal and prepare follow-ups (pageSize on struct, free page reporting).
Test plan