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

Linux 5.12 update: bio_max_segs() replaces BIO_MAX_PAGES #11765

Merged
merged 1 commit into from
Mar 20, 2021

Conversation

ckane
Copy link
Contributor

@ckane ckane commented Mar 17, 2021

The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Signed-off-by: Coleman Kane ckane@colemankane.org

Description, Motivation, and Context

The BIO_MAX_PAGES macro has been superseded by a new bio_max_segs() inline function that performs the tests for which it was intended in a more concise and mathematically correct way. The former macro was removed, and this broke the build. This commit fixes that problem by testing for the existence of the new bio_max_segs() API, and preferring it, where it exists.

How Has This Been Tested?

I have been running this change on Linux 5.12rc3 on my daily use personal system with ZFS root.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 17, 2021
@ckane
Copy link
Contributor Author

ckane commented Mar 17, 2021

FYI - since this commit modifies config/kernel.m4 as well, I will have to rebase and re-apply after #11712 gets merged, to ensure cleaner commit history.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 17, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Signed-off-by: Coleman Kane <ckane@colemankane.org>
@ckane
Copy link
Contributor Author

ckane commented Mar 20, 2021

Updated with a clean rebase against latest master (with my earlier changes)

@behlendorf behlendorf merged commit ffd6978 into openzfs:master Mar 20, 2021
jsai20 pushed a commit to jsai20/zfs that referenced this pull request Mar 30, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes openzfs#11765
adamdmoss pushed a commit to adamdmoss/zfs that referenced this pull request Apr 10, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes openzfs#11765
behlendorf pushed a commit that referenced this pull request May 20, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #11765
(cherry picked from commit ffd6978)
Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev>
sempervictus pushed a commit to sempervictus/zfs that referenced this pull request May 31, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes openzfs#11765
tonyhutter pushed a commit that referenced this pull request Jun 23, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #11765
(cherry picked from commit ffd6978)
Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev>
veggiemike pushed a commit to veggiemike/zfs that referenced this pull request Sep 6, 2021
The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs()
function that implements the typical MIN(x,y) logic used throughout the
kernel for bounding the allocation, and also the new implementation is
intended to be signed-safe (which the former was not).

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes openzfs#11765
(cherry picked from commit ffd6978)
Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants