scsi_probe_lun(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the scsi_device we're probing. it's giving main character energy, this is the one we care about πŸ’–
  • inq_result β€” the area where we stash the INQUIRY result. your little data cubby πŸ“
  • result_len β€” the len of inq_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 not 0, you don't get to walk away assuming any of that copying happened. the INQUIRY has 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 πŸ’•


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