scsi_dma_map(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« scsi_dma_map(9) πŸ’«

okay so this is a page from the Kernel API Manual, bestie, and it's literally all about scsi_dma_map β€” the little function that does DMA mapping against a command's sg lists. it's giving "quiet hero of the SCSI layer" energy and i'm obsessed πŸŽ€


✨ NAME ✨

scsi_dma_map β€” perform DMA mapping against command's sg lists

like yes, that's the whole vibe: it takes your command's scatter-gather lists and gets them DMA-mapped. no cap. πŸ¦‹


🌸 SYNOPSIS 🌸

int scsi_dma_map (struct scsi_cmnd *cmd );

that's it, that's the signature β€” copy it exactly, don't be cute with it πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • cmd β€” the scsi command. that's the one and only thing you hand over 🫢

πŸ’– DESCRIPTION πŸ’–

okay so here's what you actually get back, and it's literally three possible situations:

  • it returns the number of sg lists actually used β€” the good ending ✨
  • it returns zero if the sg lists is NULL β€” nothing to map, so nothing to report 🌈
  • it returns -ENOMEM if the mapping failed β€” the sad ending 😭

that's the entire contract, bestie. number of sg lists used, 0 for the NULL case, -ENOMEM when it goes wrong. periodt. πŸ‘‘

fr fr read the return carefully β€” 0 and -ENOMEM are two completely different stories and you do not wanna mix them up πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/scsi/scsi_lib_dma.c β€” go read the source, it's right there 🧚
  • scsi_dma_unmap(9) β€” the matching undo button, obviously you need both πŸ’œ

and that's the page!! πŸ’… source/version is ./drivers/scsi and the date on this beauty is October 2026 β€” go forth and map those sg lists responsibly, mwah πŸ“πŸ’–β­

πŸ“¦ where this page comes from