scsi_kmap_atomic_sg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« scsi_kmap_atomic_sg πŸ’«

okay bestie, welcome to the Kernel API Manual β€” this one's a little function from the SCSI corner of the kernel and it's genuinely so useful, so let's get into it 🫢


✨ NAME ✨

scsi_kmap_atomic_sg β€” find and atomically map an sg-elemnt πŸ’…

(yes, "elemnt". that's how it's spelled in the source. we respect the typo here, no cap πŸŽ€)


🌸 SYNOPSIS 🌸

void * scsi_kmap_atomic_sg (struct scatterlist *sgl , int sg_count ,
       size_t *offset , size_t *len );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • sgl β€” the scatter-gather list, aka the lineup of memory pieces you're working with 🌈
  • sg_count β€” number of segments in sg, like how many baddies are in the group chat
  • offset β€” offset in bytes into sg, and on return it's the offset into the mapped area (yes it does double duty, main character behavior tbh πŸ‘‘)
  • len β€” bytes to map, and on return it's the number of bytes mapped ✨

πŸ’œ DESCRIPTION πŸ’œ

Returns virtual address of the start of the mapped page. that's it, that's the whole vibe. a void * straight to the good stuff πŸ’–


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/scsi/scsi_lib.c β€” go read it, it's lowkey iconic πŸ“–

and now, the extended universe, because there are literally 40 of these and i'm not skipping a single one, periodt:

all 40, accounted for, nobody left on read πŸ’…


ngl bestie, scsi_kunmap_atomic_sg(9) is right there in that list for a reason β€” if you map it, you're gonna have to unmap it. do not forget. i'm not saying you would. i'm just saying. πŸ™ˆ

k bye love u, this page came to you from ./drivers/scsi, dated October 2026, and it's the scsi_kmap_atomic_sg(9) page β€” slay, go map something atomically πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from