kref_put_lock(9)
π kref_put_lock(9) π
Okay bestie, welcome to the Kernel API Manual β this one is short, but it's giving very specific refcount-with-a-lock energy β¨
πΈ NAME πΈ
kref_put_lock β Decrement refcount for object π
β¨ SYNOPSIS β¨
int kref_put_lock (struct kref *kref , void (*release)(struct kref
*kref) , spinlock_t *lock );
π¦ ARGUMENTS π¦
krefβ the object, bestie. That's the thing we're working with.releaseβ pointer to the function that will clean up the object when the last reference to the object is released. Like, the final goodbye handler πlockβ the spinlock which protects the release function. It's literally the bodyguard forreleaseπ₯
π DESCRIPTION π
Okay so this variant of kref_lock calls the release function with the lock held. The release function will release the lock. That's the whole situation β lock held while release does its thing, then release unlocks it. No cap π«Ά
β SEE ALSO β
Kernel file ./include/linux/kref.h β plus these iconic references, iykyk:
xoxo, signed off by source/version ./include/linux π dated October 2026 π all for kref_put_lock(9) π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms