Skip to content

linux/atomic: fill out API for atomic pointer ops#17580

Merged
behlendorf merged 1 commit intoopenzfs:masterfrom
robn:linux-atomic-pointer-ops
Jul 31, 2025
Merged

linux/atomic: fill out API for atomic pointer ops#17580
behlendorf merged 1 commit intoopenzfs:masterfrom
robn:linux-atomic-pointer-ops

Conversation

@robn
Copy link
Copy Markdown
Member

@robn robn commented Jul 30, 2025

[Sponsors: Klara, Inc., Wasabi Technology, Inc.]

Motivation and Context

We have them for FreeBSD and userspace, and I reached for them, and didn't get them on Linux.

Description

Follow the existing pattern for atomic_cas_ptr to produce atomic_swap_ptr, atomic_load_ptr and atomic_save_ptr.

Worth noting that Linux doesn't have standard atomics for pointers, so we can't just wrap those, but they wouldn't be especially different to these anyway.

Asides: probably these can be global, not OS-specific, and possibly they can get some style updates (mainly inline vs __inline__), and it's probably worth thinking about 32-bit support in general. But not today!

How Has This Been Tested?

Compile checked for master. Used on a private project to replace use of atomic_*_64 with some messy casting, and worked just fine. The 32-bit ones, not tested at all.

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:

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
@amotin amotin added the Status: Code Review Needed Ready for review and testing label Jul 30, 2025
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jul 30, 2025
@behlendorf behlendorf merged commit 1aec627 into openzfs:master Jul 31, 2025
40 of 41 checks passed
spauka pushed a commit to spauka/zfs that referenced this pull request Aug 30, 2025
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#17580
@robn robn deleted the linux-atomic-pointer-ops branch January 9, 2026 02:37
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Jan 30, 2026
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#17580
arter97 pushed a commit to arter97/zfs that referenced this pull request Feb 5, 2026
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#17580
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#17580
pcd1193182 pushed a commit to KlaraSystems/zfs that referenced this pull request Apr 8, 2026
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#17580
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