sg_virt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« sg_virt(9) β€” the kernel API manual, bestie edition πŸ’«

okay so real quick: this is sg_virt(9) from the Kernel API Manual, and it lives over in ./include/linux. come on a little tour with me πŸŽ€


✨ NAME ✨

sg_virt β€” returns the virtual address of an sg entry. that's it. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

void * sg_virt (struct scatterlist *sg );

πŸ’– ARGUMENTS πŸ’–

  • sg β€” the SG entry, bestie. the one you want the virtual address of. πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

so what actually happens: this calls page_address on the page inside this sg entry, and then it adds the sg offset. that's the whole recipe πŸ“

⚠️ but here's the catch, and it's a big one: the caller must know that the sg page has a valid virtual mapping. no cap. this function is not out here checking for you β€” that's on you, and if you're wrong, that's a you problem. πŸ’€

🌈 SEE ALSO 🌈

kernel file ./include/linux/scatterlist.h β€” and literally the whole sg friend group:

like, the entire friend group showed up to the function. obsessed. 🫢


okay that's the page!! sign-off time: this one shipped out of ./include/linux, dated October 2026, and it's filed under sg_virt(9). periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from