scsi_alloc_request(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… scsi_alloc_request β€” kernel API manual, bestie edition ✨

okay so real talk, this is the manual page for scsi_alloc_request(9) from the Kernel API Manual, and it's genuinely one of those little functions that does exactly what it says on the tin. πŸŽ€


πŸ¦‹ NAME πŸ¦‹

scsi_alloc_request β€” allocate a block request and partially initialize its &scsi_cmnd

like, it hands you a request, and it starts setting up the &scsi_cmnd inside it β€” partially, bestie, not fully. don't come for it for not finishing the job, that's literally in the name of the description. πŸ’–


✨ SYNOPSIS ✨

struct request * scsi_alloc_request (struct request_queue *q , blk_opf_t
opf , blk_mq_req_flags_t flags );

return type is struct request *, three arguments, no cap. 🌸


🌈 ARGUMENTS 🌈

  • q β€” the device's request queue. this is the queue you're pulling from, the main character's home base πŸ‘‘
  • opf β€” the request operation code. the what kind of operation is this vibe check πŸ”₯
  • flags β€” block layer allocation flags. the little knobs and dials that tell the block layer how to behave while it allocates 🧚

πŸ’œ RETURN πŸ’œ

struct request pointer on success ✨ or NULL on failure 😭

lowkey important: NULL means it did not work. check it. fr fr. do not just vibe forward and dereference it, that's how you get a crash and a sad kernel πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/scsi/scsi_lib.c β€” __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_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)

that's a whole friend group right there, the entire SCSI squad in ./drivers/scsi 🫢 iykyk πŸ’…


sign-off era 🌈 this page lives in ./drivers/scsi, dated October 2026, and it's page scsi_alloc_request(9) of the Kernel API Manual β€” slay, drink water, and always check your return values bestie πŸ“βœ¨πŸ’–
πŸ“¦ where this page comes from