Skip to content

Move range_tree, btree, highbit64 to common code#18133

Merged
behlendorf merged 1 commit intoopenzfs:masterfrom
tonyhutter:move_range_tree
Feb 22, 2026
Merged

Move range_tree, btree, highbit64 to common code#18133
behlendorf merged 1 commit intoopenzfs:masterfrom
tonyhutter:move_range_tree

Conversation

@tonyhutter
Copy link
Contributor

Motivation and Context

Break out range_tree/btree/highbit64/lowbit64 code for #17864

Description

Break out the range_tree, btree, and highbit64/lowbit64 code from kernel space into shared kernel and userspace code. This is needed for the updated zpool status -vv error byte range reporting that will be coming in a future commit. That commit needs the range_tree code in kernel and userspace.

How Has This Been Tested?

Test built

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)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • 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:

@tonyhutter
Copy link
Contributor Author

Note - I kept highbit64() and lowbit64() as inline functions rather than macros, since some parts of our code expected them to return an int specifically.

Break out the range_tree, btree, and highbit64/lowbit64 code from kernel
space into shared kernel and userspace code.  This is needed for the
updated `zpool status -vv` error byte range reporting that will be
coming in a future commit.  That commit needs the range_tree code in
kernel and userspace.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
@tonyhutter
Copy link
Contributor Author

I think this is ready for review

@tonyhutter tonyhutter added the Status: Code Review Needed Ready for review and testing label Jan 22, 2026
@amotin amotin requested a review from robn February 16, 2026 15:47
Copy link
Member

@robn robn left a comment

Choose a reason for hiding this comment

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

Works for me!

(incidentally, I've a bunch of stuff in-flight around linkages, symbol visibility, common code, etc, so I will likely end up shuffling this a bit along with a ton of other stuff when I get back to it. Nothing here changes anything for me there, and hopefully next time this sort of thing will be a lot easier).

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 22, 2026
@behlendorf behlendorf merged commit d2f5cb3 into openzfs:master Feb 22, 2026
26 checks passed
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