scsi_device_from_queue(9)
π scsi_device_from_queue(9) π
okay so bestie, welcome to the scsi_device_from_queue(9) page β that's the manual name, and yes it's a whole mouthful, but it's literally just a little kernel API helper from the Kernel API Manual and it's giving "short and sweet and does exactly one thing." π
β¨ NAME β¨
scsi_device_from_queue β return the sdev associated with a request_queue π¦
πΈ SYNOPSIS πΈ
struct scsi_device * scsi_device_from_queue (struct request_queue *q );
like, that's it. that's the whole signature. no cap. β¨
π ARGUMENTS π
qβ the request queue you want the sdev out of. that's the one and only input, bestie π«Ά
π DESCRIPTION π
so here's the vibe check: this function returns the sdev that's associated with a request queue. π
and if the request_queue does not reference a SCSI device? you get NULL. periodt. no error code, no drama, just NULL β so like, check it before you go dereferencing it, iykyk π
π SEE ALSO π
oh honey, this is the part where the whole friend group shows up. all of these live in the kernel file ./drivers/scsi/scsi_lib.c β go say hi π
__scsi_queue_insert(9)scsi_queue_insert(9)scsi_failures_reset_retries(9)scsi_check_passthrough(9)scsi_execute_cmd(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_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, you ate that π go forth and grab your sdev, bestie π
and finally, the cute little sign-off corner π: this page comes to you from ./drivers/scsi, dated October 2026, and it's scsi_device_from_queue(9) all the way down. mwah πβ¨π·
π¦ 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