scsi_device_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 hold host_lock of the parent Scsi_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:


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