Fix version-check macro precedence and collapse write_begin variants - #96
Merged
Conversation
The SIMPLEFS_AT_LEAST/SIMPLEFS_LESS_EQUAL macro bodies lacked outer parentheses.
The four per-kernel simplefs_write_begin variants duplicated the same body and differed only in signature and the block_write_begin call.
Collaborator
|
Thank @RoyWFHuang for contributing! |
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.
1. Add missing parentheses to version-check macros
SIMPLEFS_AT_LEAST()andSIMPLEFS_LESS_EQUAL()lacked outer parentheses:Unary
!binds tighter than>=, so#if !SIMPLEFS_AT_LEAST(6, 15, 0)in file.c expanded to#if (!LINUX_VERSION_CODE) >= KERNEL_VERSION(6, 15, 0), which is false on every kernel..writepagewas dropped fromsimplefs_aopseverywhere, not just on 6.15+.2. Collapse duplicated simplefs_write_begin variants
The four per-kernel variants each carried a full copy of the same body, differing only in signature and in the arguments to
block_write_begin().Summary by cubic
Fixes version-check macro precedence and deduplicates
simplefs_write_begin. Restores correct kernel gating (e.g.,.writepageonly dropped on 6.15+) and reduces maintenance.Bug Fixes
SIMPLEFS_AT_LEAST()andSIMPLEFS_LESS_EQUAL()to enforce correct precedence.#if !SIMPLEFS_AT_LEAST(6, 15, 0)mis-evaluation that dropped.writepageon all kernels.Refactors
simplefs_write_beginvariants into one implementation.block_write_begin()call/signature is selected via version guards.Written for commit 65bec5b. Summary will update on new commits.