__compat_vma_mmap(9)
π __compat_vma_mmap(9)
okay so bestie, welcome to the kernel API manual page for __compat_vma_mmap(9) β yes that's the manual name, it's giving "underscore-underscore" main character energy and we're obsessed π«Ά
β¨ NAME β¨
__compat_vma_mmap β literally the same vibe as compat_vma_mmap(), except it's flexible about how the mmap_prepare callback gets invoked. which is super useful for drivers that invoke nested mmap_prepare callbacks inside an mmap() hook. iykyk π
π SYNOPSIS π
int __compat_vma_mmap (struct vm_area_desc *desc , struct vm_area_struct
*vma );
πΈ ARGUMENTS πΈ
descβ a VMA descriptor that has already had anmmap_preparehook executed on it. like, done, dusted, no takebacks β¨vmaβ the VMA thatdescshould be applied to. matching energies, fr fr π¦
π DESCRIPTION π
so this function is lowkey assuming a whole lot about you: it assumes you've already gotten yourself a VMA descriptor desc from compat_set_desc_from_vma, and that you've already executed the mmap_prepare hook on it. like, girl, do your homework first π
after that, it performs any specified mmap actions, and then it invokes the vm_ops->mapped hook if one is present. slay π₯
for more details, go read the description of compat_vma_mmap β it's got the lore π
heads up bestie: once the conversion of drivers is complete, this function will no longer be required and will be removed. so don't get too attached, it's a limited-edition drop π
β RETURN β
0 on success, or error. that's it, that's the whole mood π
π SEE ALSO π
kernel file ./mm/util.c, plus the whole friend group:
kfree_const(9)__kmemdup_nul(9)kstrdup(9)kstrdup_const(9)kstrndup(9)kmemdup(9)kmemdup_array(9)kvmemdup(9)kmemdup_nul(9)memdup_user(9)vmemdup_user(9)strndup_user(9)memdup_user_nul(9)randomize_page(9)__account_locked_vm(9)account_locked_vm(9)__vmalloc_array(9)vmalloc_array(9)__vcalloc(9)vcalloc(9)folio_mapping(9)folio_copy(9)get_cmdline(9)mem_dump_obj(9)compat_set_desc_from_vma(9)compat_vma_mmap(9)snapshot_page(9)mmap_action_prepare(9)mmap_action_complete(9)folio_pte_batch(9)page_range_contiguous(9)
and that's the whole page, bestie π§ coming at you straight from the ./mm directory, dated October 2026 β __compat_vma_mmap(9) out, 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