scsi_dma_map(9)
π« 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
-ENOMEMif 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 β0and-ENOMEMare 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms