scsi_device_from_queue(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– scsi_device_from_queue(9) πŸ’–

okay so bestie, welcome to the scsi_device_from_queue(9) page β€” that's the manual name, and yes it's a whole mouthful, but it's literally just a little kernel API helper from the Kernel API Manual and it's giving "short and sweet and does exactly one thing." πŸŽ€


✨ NAME ✨

scsi_device_from_queue β€” return the sdev associated with a request_queue πŸ¦‹


🌸 SYNOPSIS 🌸

struct scsi_device * scsi_device_from_queue (struct request_queue *q );

like, that's it. that's the whole signature. no cap. ✨


πŸ’… ARGUMENTS πŸ’…

  • q β€” the request queue you want the sdev out of. that's the one and only input, bestie 🫢

🌈 DESCRIPTION 🌈

so here's the vibe check: this function returns the sdev that's associated with a request queue. πŸŽ€

and if the request_queue does not reference a SCSI device? you get NULL. periodt. no error code, no drama, just NULL β€” so like, check it before you go dereferencing it, iykyk 😭


πŸ‘‘ SEE ALSO πŸ‘‘

oh honey, this is the part where the whole friend group shows up. all of these live in the kernel file ./drivers/scsi/scsi_lib.c β€” go say hi πŸ’–


ok that's the whole page, you ate that πŸ’… go forth and grab your sdev, bestie πŸ’–

and finally, the cute little sign-off corner πŸŽ€: this page comes to you from ./drivers/scsi, dated October 2026, and it's scsi_device_from_queue(9) all the way down. mwah πŸ’‹βœ¨πŸŒ·

πŸ“¦ where this page comes from