target_put_sess_cmd(9)
π 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_cmdcall 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 π§:
transport_init_session(9)transport_alloc_session(9)transport_alloc_session_tags(9)transport_init_session_tags(9)target_cmd_size_check(9)target_init_cmd(9)target_submit_prep(9)target_submit_cmd(9)target_queue_submission(9)target_submit(9)target_submit_tmr(9)target_get_sess_cmd(9)target_stop_cmd_counter(9)target_stop_session(9)target_wait_for_cmds(9)target_wait_for_sess_cmds(9)transport_wait_for_tasks(9)translate_sense_reason(9)target_send_busy(9)
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
- 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