target_put_sess_cmd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… target_put_sess_cmd β€” bestie's guide to the kernel API manual

okay so first things first, this is a page from the Kernel API Manual (yes, that's the section-9 vibe, kernel devs only, iykyk πŸ’–). The star of the show is target_put_sess_cmd, and she is literally the reverse card of the session-command world. Let's get into it πŸŽ€


✨ NAME ✨

target_put_sess_cmd β€” decrease the command reference count 🫢

Like, she's the one you call when you're done with a command and you're handing your reference back. Polite. Iconic. Minimal. Periodt.


🌸 SYNOPSIS 🌸

int target_put_sess_cmd(struct se_cmd *se_cmd);

That's the whole signature, no cap. She takes one pointer and gives you back an int. Simple queen behaviour πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • se_cmd β€” the command you're dropping a reference from, bestie. That's it. That's the argument. Not me being vague, that's genuinely all the original says πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜• β€” the return value on this one is very specific and you gotta respect it:

  • She returns 1 if and only if this target_put_sess_cmd call was the one that caused the refcount to drop to zero. Like, you were the last one holding a reference and now she's free. Main character moment, honestly πŸ‘‘
  • She returns zero otherwise. Every other case. No drama, no surprises, just 0 πŸ“
Fr fr: "if and only if" is doing real work in that sentence. Don't be out here treating a 1 as "success" in the generic sense β€” it means this specific call hit zero. That's the whole semantic, and the original is very precise about it πŸ’œ

πŸ’€ SEE ALSO πŸ’€

okay so the source file for all of this lives right here:

Kernel file ./drivers/target/target_core_transport.c

and here's the whole friend group, all in section 9, all linked together β€” go say hi 🧚:

Lowkey note that target_get_sess_cmd(9) is right there in the list and she's basically the opposite energy β€” get it, then put it. Balanced, as all things should be 🌈

🌟 sign-off 🌟

This page comes to you from the source path ./drivers/target, dated October 2026 β€” so yeah, future girl summer over here ⭐ Anyway, that's the whole manual page, you ate that, go forth and decrement responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from