kfifo_in_spinlocked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kfifo_in_spinlocked β€” kernel API manual, but make it cute

okay so bestie, welcome to the kfifo_in_spinlocked(9) page πŸŽ€ this is a kernel API manual entry, and honestly? it's a small one, but it's iconic. it does exactly one thing and it does it with a spinlock, which is the most "i have main character energy but i also need to be thread-safe" move ever. periodt.


✨ NAME ✨

kfifo_in_spinlocked β€” put data into the fifo using a spinlock for locking πŸ”’πŸ’«

like, that's the whole vibe. you got data, you got a fifo, and you got a spinlock holding it down so nothing gets messy. no cap.


🌸 SYNOPSIS 🌸

kfifo_in_spinlocked (fifo , buf , n , lock );

yes she's a macro, yes she takes four things, yes the spacing is a little funky, we don't judge πŸ’œ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • fifo β€” address of the fifo to be used. this is your girl, your container, the whole point πŸ’–
  • buf β€” the data to be added. this is what you're sliding in there ✨
  • n β€” number of elements to be added. how many lil guys are we talking πŸ“
  • lock β€” pointer to the spinlock to use for locking. pointer, bestie, it's a pointer πŸ”’

🧚 DESCRIPTION 🧚

so here's the tea β˜• this macro copies the given values buffer into the fifo, and then it returns the number of copied elements. that's it. that's the whole function. she's efficient, she's locked, she's slaying πŸ’…

and reminder: the return value is literally the count of what actually got copied, so don't be out here assuming it's always n, because it is not claiming that πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

the full kfifo friend group, assembled, in original order, no one left out 🫢 this is the group chat and everyone's here:

also, the kernel file lives at ./include/linux/kfifo.h β€” that's the home base, the source of truth, go read her πŸ’œ


ok one tiny note bestie: this page literally just says the macro copies the values buffer in and returns the number of copied elements. that's the entire description. no extra lore, no hidden mechanics have been invented here, so don't come for me if you wanted more tea 😭 i'm just telling you what the page tells you, fr fr.

and that's the page!! 🌈 ty for coming to my ted talk, go forth and fifo responsibly. this lil beauty is from ./include/linux, dated October 2026, and it's the kfifo_in_spinlocked(9) page β€” mwah πŸ’‹β­πŸ’–

πŸ“¦ where this page comes from