find_vma_prev(9)
β¨ find_vma_prev β the kernel API manual, bestie edition β¨
okay so real talk, this one is a kernel API manual page (find_vma_prev(9), in case the header didn't already scream it) and honestly? it's iconic in a lowkey way. let's get into it π
π NAME π
find_vma_prev β find the VMA for a given address, or the next vma, and set %pprev to the previous VMA, if any. that's it, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
struct vm_area_struct * find_vma_prev (struct mm_struct *mm , unsigned long addr , struct vm_area_struct **pprev );
like yes, it's a whole mouthful of a signature, but she's worth it π«Ά
π ARGUMENTS π
mmβ themm_structyou're checking, aka the main character of this whole operation πaddrβ the address. that's it. that's the address β¨pprevβ the pointer you're setting to the previous VMA π₯
π DESCRIPTION π
ngl, there's a little plot twist here: the RCU lock is missing in this function, and that's on purpose β because the external mmap_lock is used instead. so don't come for her about the RCU lock, okay? it's giving "i have a different system and it works for me" π
β RETURN β
you get back the VMA associated with addr, or the next vma π₯ and heads up: it may return NULL in the case of no vma at addr or above β so, y'know, vibe check your return value before you use it ππ
π¦ SEE ALSO π¦
- Kernel file
./mm/mmap.c do_mmap(9)find_vma_intersection(9)find_vma(9)
go read those too, iykyk π
fr fr, that's the whole page β no cap, no missing flags, nothing skipped π§
okay bestie that's a wrap!! this little gem lives in ./mm and the version/date on the tin says October 2026 β so go forth and find those VMAs 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