atomic_fetch_and_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_fetch_and_release(9) β€” Kernel API Manual πŸ’…

okay so bestie, this is atomic_fetch_and_release from the Kernel API Manual, section 9, and it's lowkey iconic. It's the atomic bitwise AND that also has release ordering. Let's get into it ✨


✨ NAME ✨

atomic_fetch_and_release β€” atomic bitwise AND with release ordering πŸŽ€


🌸 SYNOPSIS 🌸

int atomic_fetch_and_release (int i , atomic_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • i β€” an int value. that's the thing you're AND-ing with, bestie πŸ’–
  • v β€” pointer to atomic_t. this is the atomic variable getting updated 🫢

πŸ”₯ DESCRIPTION πŸ”₯

Atomically updates v to (v & i) with release ordering. yes, atomically β€” it's giving main character energy, no cap πŸ’…

⚠️ Unsafe to use in noinstr code β€” use raw_atomic_fetch_and_release there instead. like, do not use this one in that context, fr fr. πŸ™ˆ

⭐ RETURN ⭐

The original value of v. you get back the pre-update value, periodt πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file is literally ./include/linux/atomic/atomic-instrumented.h, and the whole atomic family showed up to the group chat πŸŒˆπŸ’–:


mwah πŸ’‹ this page lives in ./include/linux/atomic, dated October 2026, and it's atomic_fetch_and_release(9) β€” see you in the kernel, bestie πŸ«ΆπŸ’–

πŸ“¦ where this page comes from