translate_sense_reason(9)
π translate_sense_reason(9)
okay so bestie, welcome to the kernel API manual for translate_sense_reason β a little function living its best life in the <pink>Kernel API Manual</pink> section 9 of the man pages. Sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
translate_sense_reason β translate a sense reason into T10 key, asc and ascq πΈ
Like, it takes your vibe-y internal reason code and turns it into the actual SCSI sense trio the world can read. It's giving translator bestie. π
β¨ SYNOPSIS β¨
void translate_sense_reason (struct se_cmd *cmd , sense_reason_t reason );
No cap, that's the whole signature. Copy it exactly, don't get creative with it π
β¨ ARGUMENTS β¨
cmdβ the SCSI command in which the resulting sense buffer or SCSI status will be stored. Basically it's the lucky little command struct that gets to hold the receipts π₯β¨reasonβ the LIO sense reason code. And okay, real talk, there's a spicy special case here: if this argument has the valueTCM_CHECK_CONDITION_UNIT_ATTENTION, the function tries to dequeue a unit attention. But β and hear me β if dequeuing a unit attention fails because multiple commands are being processed concurrently, it sets the command status toBUSY. Concurrency said "not today" π
β¨ RETURN β¨
0 upon success, or -EINVAL if the sense buffer is too small π
So if the sense buffer is too small, that's a -EINVAL, not a crash, not a shrug. Respect the buffer size, bestie. π
β¨ SEE ALSO β¨
The kernel file lives at ./drivers/target/target_core_transport.c β go say hi π¦
and obviously the whole friend group π«Ά:
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_put_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)target_send_busy(9)
that's the whole page, icon, go forth and translate those sense reasons β¨
sign-off incoming: this one's filed under ./drivers/target, dated October 2026 β mwah, bye bestie ππ
π¦ 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