scsi_execute_cmd(9)
π« scsi_execute_cmd(9) π«
okay so bestie, welcome to the Kernel API Manual β this one's a kernel-API girly and honestly she's kind of a big deal. Let's get into it β¨
πΈ NAME πΈ
scsi_execute_cmd β insert request and wait for the result
like, you yeet the request in and then you wait. main character behavior fr π
π¦ SYNOPSIS π¦
int scsi_execute_cmd (struct scsi_device *sdev , const unsigned char
*cmd , blk_opf_t opf , void *buffer , unsigned int bufflen , int timeout
, int ml_retries , const struct scsi_exec_args *args );
π ARGUMENTS π
sdevβ thescsi_device. the whole reason we're here π«Άcmdβ the scsi command. iconic, necessaryopfβ block layer requestcmd_flags. flags girlies risebufferβ data buffer. hold the data bestiebufflenβ len of buffer. yes, that's the length. of the buffer. πtimeoutβ request timeout in HZ. don't let it wait forever nglml_retriesβ number of times SCSI midlayer will retry request. she's persistent β¨argsβ Optional args. See struct definition for field descriptions. optional but lowkey important π
π DESCRIPTION π
Returns the scsi_cmnd result field if a command was executed, or a negative Linux error code if we didn't get that far.
so like β if it actually ran, you get the scsi_cmnd result field. if we never even got that far, you get a negative Linux error code instead. vibe check failed, basically π
β SEE ALSO β
Kernel file ./drivers/scsi/scsi_lib.c β and here's the whole friend group, no cap:
__scsi_queue_insert(9)scsi_queue_insert(9)scsi_failures_reset_retries(9)scsi_check_passthrough(9)scsi_run_queue(9)scsi_result_to_blk_status(9)scsi_rq_err_bytes(9)scsi_io_completion(9)scsi_alloc_sgtables(9)scsi_initialize_rq(9)scsi_alloc_request(9)scsi_dispatch_cmd(9)scsi_get_internal_cmd(9)scsi_put_internal_cmd(9)scsi_device_from_queue(9)scsi_block_requests(9)scsi_unblock_requests(9)scsi_mode_select(9)scsi_mode_sense(9)scsi_test_unit_ready(9)scsi_device_set_state(9)scsi_evt_emit(9)scsi_evt_thread(9)sdev_evt_send(9)sdev_evt_alloc(9)sdev_evt_send_simple(9)scsi_device_quiesce(9)scsi_device_resume(9)scsi_internal_device_block_nowait(9)scsi_device_block(9)scsi_internal_device_unblock_nowait(9)scsi_internal_device_unblock(9)scsi_block_targets(9)scsi_host_block(9)scsi_kmap_atomic_sg(9)scsi_kunmap_atomic_sg(9)scsi_vpd_lun_id(9)scsi_vpd_lun_serial(9)scsi_vpd_tpg_id(9)scsi_build_sense(9)
ok that's the whole page bestie, go forth and execute commands responsibly π§ββοΈ
mwah π this page lives in ./drivers/scsi and it's stamped October 2026 β scsi_execute_cmd(9) out. periodt πβ¨
π¦ 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