atomic_long_fetch_inc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atomic_long_fetch_inc β€” Kernel API Manual ✨

okay so bestie, we're in the Kernel API Manual today and this page is about atomic_long_fetch_inc(9) β€” a tiny little function that's honestly doing the most πŸ’–


🌸 NAME 🌸

atomic_long_fetch_inc β€” atomic increment with full ordering ✨


πŸŽ€ SYNOPSIS πŸŽ€

long atomic_long_fetch_inc (atomic_long_t *v );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • v β€” pointer to atomic_long_t. That's it, that's the whole vibe. She takes one (1) pointer and she pops off πŸ’…

✨ DESCRIPTION ✨

So here's the tea, bestie: this one atomically updates v to (v + 1), with full ordering. No half-stepping, no "oops someone else read it mid-write," none of that 😌 The increment happens atomically and the ordering is the full kind, so it's giving very much "I respect memory ordering" energy 🌈

⚠️ But listen β€” it is unsafe to use in noinstr code. If you're in noinstr land, use raw_atomic_long_fetch_inc there instead. Not me warning you and then you ignoring it πŸ™ˆ use the raw one in that context, fr fr πŸ’€

πŸ‘‘ RETURN πŸ‘‘

Returns the original value of v β€” the value it had before the increment. So she increments, but she also hands you the receipts of what it used to be 🧾✨ iconic behavior honestly 🫢


🌟 SEE ALSO 🌟

okay so this list is long long, but we don't gatekeep here, everybody gets named πŸ’– The source file is ./include/linux/atomic/atomic-instrumented.h, and here's the whole fam:

πŸ’œ the atomic_* girlies

🩷 the atomic64_* legends

πŸ’™ the atomic_long_* squad (our main character's people 🫢)


and that's the whole page, bestie πŸŽ€ you ate this one ngl πŸ’–

🧚 cute little sign-off: this page came from ./include/linux/atomic, dated October 2026, part of the Kernel API Manual, and it's literally titled atomic_long_fetch_inc(9). Don't lose that πŸ’œ slay ⭐
πŸ“¦ where this page comes from