scsi_device_get(9)
π¦ scsi_device_get(9) π¦
okay bestie, welcome to the Kernel API Manual page for scsi_device_get(9) β it's giving reference-counting realness and we're gonna get through it together π«Άβ¨
π NAME π
scsi_device_get β get an additional reference to a scsi_device, periodt. It's the +1 bestie your device needs π
β¨ SYNOPSIS β¨
here's the exact signature, no cap:
int scsi_device_get (struct scsi_device *sdev );
π ARGUMENTS π
sdevβ the device you're getting a reference to. That's the whole assignment, bestie π
πΈ DESCRIPTION πΈ
Okay so scsi_device_get gets a reference to the scsi_device and increments the use count of the underlying LLDD module. No cap.
β οΈ bestie, you must holdhost_lockof the parentScsi_Host, or already have a reference when calling this. Those are the rules, fr fr.
This will fail if a device is deleted or cancelled, or when the LLD module is in the process of being unloaded. So if teardown is happening, do not expect this to slay π
π₯ SEE ALSO π₯
Kernel file: ./drivers/scsi/scsi.c
the whole squad:
scsi_finish_command(9)scsi_change_queue_depth(9)scsi_track_queue_full(9)scsi_vpd_inquiry(9)scsi_get_vpd_page(9)scsi_get_vpd_buf(9)scsi_attach_vpd(9)scsi_report_opcode(9)scsi_cdl_check(9)scsi_cdl_enable(9)scsi_device_put(9)starget_for_each_device(9)__starget_for_each_device(9)__scsi_device_lookup_by_target(9)scsi_device_lookup_by_target(9)__scsi_device_lookup(9)scsi_device_lookup(9)
made with π from source/version ./drivers/scsi, dated October 2026 β mwah, go be iconic and hold that host_lock 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