raw_atomic_..._and_release(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_..._and_release(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for raw_atomic_long_fetch_and_release, and honestly? it's giving "small function, big responsibilities" πŸŽ€. Full name in the header is raw_atomic_..._and_release(9) (yes the ... is literally part of the page name, iykyk πŸ¦‹), and the whole thing lives over at ./include/linux/atomic.


🌸 NAME 🌸

raw_atomic_long_fetch_and_release β€” atomic bitwise AND, but with release ordering, periodt πŸ’…


✨ SYNOPSIS ✨

long raw_atomic_long_fetch_and_release (long i , atomic_long_t *v );

🫢 ARGUMENTS 🫢

  • i β€” a long value. just a long. that's the whole vibe πŸ’œ
  • v β€” pointer to an atomic_long_t πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea β˜•: it atomically updates v to (v & i) with release ordering πŸ”₯. Atomically, bestie β€” nobody gets to see a half-done bitwise AND, no cap.

Also it's safe to use in noinstr code β€” which is a whole flex 🧚. But literally everywhere else, prefer atomic_long_fetch_and_release instead. like, the non-raw one. that's your main character. this one is for the special noinstr situations only πŸ’€


🌈 RETURN 🌈

The original value of v β€” yes, the value from before the AND happened. a little time capsule πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/atomic/atomic-long.h β€” go read it, it's iconic πŸ“–βœ¨

And now the full friend group, everybody say hi 🫢:


and that's the whole page bestie, you ate that πŸ’… mwah 🫢

source file ./include/linux/atomic, dated October 2026, page raw_atomic_..._and_release(9) β€” ok bye, go AND some bits, love u πŸ’–βœ¨

πŸ“¦ where this page comes from