scsi_device_...up_by_target(9)
π scsi_device_lookup_by_target(9) β the kernel API manual bestie β¨
Okay so like, welcome to the Kernel API Manual entry for scsi_device_lookup_by_target(9) β this is literally the glow-up version of that manpage, and we're gonna get you fluent in it, no cap. π«Ά
πΈ NAME πΈ
scsi_device_lookup_by_target β find a device given the target
β¨ SYNOPSIS β¨
struct scsi_device * scsi_device_lookup_by_target (struct scsi_target
*starget , u64 lun );
π ARGUMENTS π
stargetβ SCSI target pointer (like, the target bestie you're searching under π)lunβ SCSI Logical Unit Number (the specific LUN you want, iykyk)
π« DESCRIPTION π«
So here's the tea: this function looks up the scsi_device with the specified lun for a given starget. Super straightforward, main character energy.
But listen β the returned scsi_device has an additional reference that needs to be released with scsi_device_put once you're done with it. Don't forget this part, bestie, or you're gonna have a leak situation and nobody wants that. π
π¦ SEE ALSO π¦
Kernel file ./drivers/scsi/scsi.c, plus all these iconic functions:
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_get(9)scsi_device_put(9)starget_for_each_device(9)__starget_for_each_device(9)__scsi_device_lookup_by_target(9)__scsi_device_lookup(9)scsi_device_lookup(9)
π Friendly reminder from your favorite Unix girlie: that extra reference isn't gonna release itself. scsi_device_put is your bestie. Periodt.
Written from ./drivers/scsi, dated October 2026 β that's the source and version, bestie, we don't gatekeep the metadata. Stay slay, stay referenced, and always put your devices when you're done. πβ¨
π¦ 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