scsi_probe_lun(9)
π scsi_probe_lun(9) β like, the Kernel API Manual page you actually want to read π
okay so bestie, welcome to the Kernel API Manual glow-up of scsi_probe_lun(9). this one's a little baddie that goes and actually talks to a LUN. yes, the SCSI kind. no, not a LUN like a moon. sit down, i gotchu π¦
β¨ NAME β¨
scsi_probe_lun β probe a single LUN using a SCSI INQUIRY, fr fr π
πΈ SYNOPSIS πΈ
int scsi_probe_lun (struct scsi_device *sdev , unsigned char *inq_result
, int result_len , blist_flags_t *bflags );
like, that's the whole vibe check right there β¬οΈ four things go in, one int comes out π₯
π ARGUMENTS π
sdevβ thescsi_devicewe're probing. it's giving main character energy, this is the one we care about πinq_resultβ the area where we stash theINQUIRYresult. your little data cubby πresult_lenβ the len ofinq_result. yes, so it knows how big the cubby is πbflagsβ store any bflags found right here. any. like, whatever we find π«Ά
π¦ DESCRIPTION π¦
Probe the lun associated with req using a standard SCSI INQUIRY β iconic, classic, no notes β¨
And now the part you actually need to know, periodt:
If the INQUIRY is successful, zero is returned π and the INQUIRY data is sitting pretty in inq_result. on top of that, the scsi_level and INQUIRY length get copied to the scsi_device, and any flags value is stored in *bflags. the way that it justβ¦ handles all of it ππ
lowkey important: success =0. if it's not0, you don't get to walk away assuming any of that copying happened. theINQUIRYhas to actually succeed first. iykyk π
π SEE ALSO π
Kernel file ./drivers/scsi/scsi_scan.c β that's the home base, the source of truth, go read it bestie π§
and the whole friend group, alphabetically-ish, all here so nobody gets left out π
scsi_complete_async_scans(9)scsi_unlock_floptical(9)scsi_alloc_sdev(9)scsi_target_reap_ref_release(9)scsi_alloc_target(9)scsi_target_reap(9)scsi_sanitize_inquiry_string(9)scsi_add_lun(9)scsi_inq_str(9)scsi_probe_and_add_lun(9)scsi_sequential_lun_scan(9)scsi_report_lun_scan(9)scsi_add_device(9)scsi_scan_target(9)scsi_prep_async_scan(9)scsi_finish_async_scan(9)scsi_scan_host(9)scsi_get_pseudo_sdev(9)
okay that's the page!! this lil gem lives under ./drivers/scsi, it's dated October 2026, and it answers to scsi_probe_lun(9) β go probe something, slay π
πβ¨
π¦ 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