msc_buffer_u..._unless_used(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… msc_buffer_u..._unless_used(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” yes, the actual kernel manual, we're doing this, and honestly? this one's kinda iconic. it's giving "polite little cleanup function that checks the vibe before it deletes anything." no cap.


✨ NAME ✨

msc_buffer_unlocked_free_unless_used β€” frees a buffer unless it's in use. that's it. that's the whole personality. πŸŽ€


🌸 SYNOPSIS 🌸

int msc_buffer_unlocked_free_unless_used (struct msc *msc );

like, you hand it an msc and it hands you back an int. simple. clean. slay.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • msc β€” the MSC device, obviously πŸ’… it's the star of the show, the main character, the whole reason we're here.

πŸ”₯ DESCRIPTION πŸ”₯

so the way this works is: it will free the MSC buffer β€” unless it's in use, or unless there's literally no allocated buffer to free in the first place. no buffer? no problem. girly just shrugs and moves on. 🫢

⚠️ but listen β€” the caller needs to hold msc::buf_mutex. like, that's not optional, that's not a suggestion, that's the rule. hold the mutex or don't come to the function. periodt. πŸ”’

⭐ RETURN ⭐

  • 0 β€” successful deallocation πŸ’– … or there was just no buffer to deallocate, which honestly also counts as a win, we love a low-stakes success.
  • -EBUSY β€” nope, there are active users 😭 the buffer is occupied, bestie, come back later.

🌈 SEE ALSO 🌈

okay this is the friend group, the whole squad, the entire intel_th cinematic universe. look at the kernel file ./drivers/hwtracing/intel_th/msu.c for the lore, and then meet the cast:

like, the whole roster. iykyk. πŸ‘‘


and that's the tea πŸ“ β€” brought to you by the lovely humans over at ./drivers/hwtracing/intel_th, dated October 2026, filed under msc_buffer_u..._unless_used(9). mwah πŸ’‹ go hold that mutex, bestie πŸ§šπŸ’œ

πŸ“¦ where this page comes from