iopt_map_file_pages(9)
π¦ iopt_map_file_pages β the kernel API manual, bestie edition π¦
okay so real talk: this is iopt_map_file_pages(9), straight out of the Kernel API Manual, and it's basically iopt_map_user_pages but for a file. Like, same energy, different source. no cap. π
β¨ NAME β¨
iopt_map_file_pages β literally "Like iopt_map_user_pages, but map a file." that's the whole vibe. it maps pages from a file instead of from user memory. iconic behavior honestly π
πΈ SYNOPSIS πΈ
int iopt_map_file_pages (struct iommufd_ctx *ictx , struct io_pagetable
*iopt , unsigned long *iova , int fd , unsigned long start , unsigned
long length , int iommu_prot , unsigned int flags );
she takes eight arguments and returns an int. yes eight. count them. we'll go through every single one, don't worry π«Ά
π ARGUMENTS π
okay bestie, buckle up, here's the full roster β nobody gets skipped, this is a no-skipping zone:
ictxβ theiommufd_ctxthat theioptis part of. like, whose family this pagetable belongs to πioptβ theio_pagetablewe're acting on. the main character of this operation, fr.iovaβ here's the tea β: ifIOPT_ALLOC_IOVAis set, this is unused on input and it holds the chosen iova on output (the kernel picks for you, slay). otherwise, it's the iova to map to on input β you're choosing, your call, your moment πfdβ the fdno of a file to map. yes, an actual file descriptor. we mapping files today πstartβ map the file starting at this byte offset. like opening a book at page 47 except it's bytes πlengthβ number of bytes to map. the size of the vibe. how much we're taking.iommu_protβ a combination ofIOMMU_READ/WRITE/etc bits for the mapping. this is where you say what's allowed β read? write? the etc bits?? whatever combination, it goes here π₯flagsβ eitherIOPT_ALLOC_IOVAor zero. two options, that's it, that's the list. pick one bestie β¨
π SEE ALSO π
go look at these, they're all connected, iykyk:
- Kernel file
./drivers/iommu/iommufd/io_pagetable.c iopt_map_user_pages(9)iopt_unmap_iova(9)iopt_unfill_domain(9)iopt_fill_domain(9)iopt_area_split(9)
π the sign-off π
this absolute banger of a page lives in ./drivers/iommu/iommufd, and it was dated October 2026. that's the source and the date, both accounted for, we don't leave facts behind in this house π§π
mwah, go map some file pages, you're gonna do amazing π
π¦ 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