vma_modify_flags(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vma_modify_flags(9) β€” your Kernel API Manual bestie moment πŸŽ€

okay so this is a page straight outta the Kernel API Manual, section 9, and it's all about getting a VMA ready for a flag glow-up ✨ β€” not actually doing the glow-up. huge difference, we'll get there 😌


🌸 NAME 🌸

vma_modify_flags β€” do all the necessary split/merge prep work so you can set the VMA flags to *@vm_flags across the range @start to @end that lives inside @vma. it's giving backstage crew energy 🫢


✨ SYNOPSIS ✨

struct vm_area_struct * vma_modify_flags (struct vma_iterator *vmi ,
struct vm_area_struct *prev , struct vm_area_struct *vma , unsigned long
start , unsigned long end , vma_flags_t *vma_flags_ptr );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • vmi β€” a valid VMA iterator, and it's gotta be positioned at vma. no vibing off to the side, it has to be literally on it πŸ’…
  • prev β€” the VMA that comes immediately before vma. or NULL if vma is the first one, in which case, no prev, no problem 🌈
  • vma β€” the VMA that contains the range start to end you're about to update. this is the main character πŸ‘‘
  • start β€” where the range to update begins. it may be offset within vma, so no cap it can start somewhere in the middle πŸ“
  • end β€” the exclusive end of the range to update. may also be offset within vma. exclusive bestie, so don't include it 😭
  • vma_flags_ptr β€” a pointer to the VMA flags that the start to end range is about to be set to. on merge, this gets updated to include the sticky flags. yes, it's a pointer, yes it changes, keep up 🧚

πŸ’– DESCRIPTION πŸ’–

IMPORTANT, read this twice bestie: the actual modification being requested here is NOT applied. periodt. what happens is the VMA is perhaps split, perhaps merged, so it can accommodate the change β€” and then the caller is expected to perform the actual modification themselves. it's a prep step, not a finish line πŸ’€

so to account for those sticky VMA flags, the vma_flags_ptr parameter points at the requested flags, and then those flags get updated. that way, if the caller goes ahead and overwrites any existing flags, they correctly retain the sticky ones. highkey thoughtful of it πŸ’œ


⭐ RETURN ⭐

a VMA that contains the range start to end, all ready for its flags to be altered to *vma_flags. slay, hand it over πŸ’…


🌈 SEE ALSO 🌈

kernel file ./mm/vma.h, plus the whole crew:

iykyk πŸ‘€


πŸŽ€ and that's the whole page, bestie! it ships from ./mm, dated October 2026, and yes the page name is literally vma_modify_flags(9) β€” iconic, no notes, bye πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from