ksmbd_conn_put(9)
π ksmbd_conn_put(9) β the kernel API manual, bestie edition β¨
okay so like, welcome to the glow-up of ksmbd_conn_put(9) π yes that's the kernel API manual page, and yes it's lowkey iconic. we're dropping references today. stay with me.
β¨ NAME β¨
ksmbd_conn_put β drop a reference, and if that was literally the last one, queue the release onto ksmbd_conn_wq so it runs from process context. periodt. π
β¨ SYNOPSIS β¨
void ksmbd_conn_put (struct ksmbd_conn *conn );
β¨ ARGUMENTS β¨
connβ the connection instance you're putting a reference to π«Ά like, this is the one you're letting go of.
β¨ DESCRIPTION β¨
bestie listen, this is the good part π₯ you can call this from any context β and I mean any β including RCU softirq callbacks and non-sleeping locks. the way that it just handles it?? because the actual release is deferred to the workqueue, so nobody's out here sleeping in a softirq. no cap. π
ksmbd_conn_wq is created in ksmbd_server_init before any conn can even be allocated, and it's destroyed in ksmbd_server_exit after rcu_barrier β so it is always non-NULL while a conn reference is held. it's giving guaranteed-valid-pointer main character energy πβ¨
fr fr though, that ordering is the whole vibe check of this function β the workqueue outlives every possible conn, so the deferred release always has somewhere safe to land π¦
β¨ SEE ALSO β¨
- Kernel file
./fs/smb/server/connection.cπ ksmbd_conn_get(9)πΈksmbd_conn_free(9)πksmbd_conn_alloc(9)βksmbd_conn_handler_loop(9)π
and that's the page, bestie π«Ά mwah π this one lives in ./fs/smb/server and it's dated October 2026 β so yeah, she's from the future and she's slaying. iykyk πβ¨
π¦ 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