__scsi_device_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __scsi_device_lookup(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” this is the page for __scsi_device_lookup(9), and the whole vibe is β€œfind a device given the host, but make it UNLOCKED.” The (UNLOCKED) is literally right there in the name, so bestie please keep that in mind 🫢

πŸŽ€ NAME πŸŽ€

__scsi_device_lookup β€” find a device given the host (UNLOCKED).

✨ SYNOPSIS ✨

struct scsi_device * __scsi_device_lookup (struct Scsi_Host *shost , uint channel , uint id , u64 lun );

🌸 ARGUMENTS 🌸

  • shost β€” SCSI host pointer
  • channel β€” SCSI channel (zero if only one channel)
  • id β€” SCSI target number (physical unit number)
  • lun β€” SCSI Logical Unit Number

πŸ¦‹ DESCRIPTION πŸ¦‹

Looks up the scsi_device with the specified channel, id, lun for a given host. The returned scsi_device does not have an additional reference.

🚨 lock warning, bestie: you must hold the host's host_lock over this call and any access to the returned scsi_device. No cap, that part is not optional πŸ’…

πŸ’€ NOTE πŸ’€

The only reason why drivers would want to use this is because they need to access the device list in irq context. Otherwise you really want to use scsi_device_lookup instead. It's giving β€œspecial-case energy,” iykyk πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/scsi/scsi.c β€” plus the whole friend group:


that's the whole page, bestie πŸ’… β€” source/version is ./drivers/scsi, date is October 2026, and the star of the show is __scsi_device_lookup(9). slay and bye πŸŽ€βœ¨

πŸ“¦ where this page comes from