Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/vma: refactor vma_modify_flags_name() to vma_modify_name()

The single instance in which we use this function doesn't actually need to
change VMA flags, so remove this parameter and update the caller
accordingly.

[lorenzo.stoakes@oracle.com: correct comment]
Link: https://lkml.kernel.org/r/77f45b2e-a748-4635-9381-a5051091087f@lucifer.local
Link: https://lkml.kernel.org/r/20250714135839.178032-1-lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Jann Horn <jannh@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lorenzo Stoakes and committed by
Andrew Morton
cfea8921 3865301d

+12 -15
+4 -4
mm/madvise.c
··· 144 144 } 145 145 #endif /* CONFIG_ANON_VMA_NAME */ 146 146 /* 147 - * Update the vm_flags and/or anon_name on region of a vma, splitting it or 148 - * merging it as necessary. Must be called with mmap_lock held for writing. 147 + * Update the vm_flags or anon_name on region of a vma, splitting it or merging 148 + * it as necessary. Must be called with mmap_lock held for writing. 149 149 */ 150 150 static int madvise_update_vma(vm_flags_t new_flags, 151 151 struct madvise_behavior *madv_behavior) ··· 161 161 return 0; 162 162 163 163 if (set_new_anon_name) 164 - vma = vma_modify_flags_name(&vmi, madv_behavior->prev, vma, 165 - range->start, range->end, new_flags, anon_name); 164 + vma = vma_modify_name(&vmi, madv_behavior->prev, vma, 165 + range->start, range->end, anon_name); 166 166 else 167 167 vma = vma_modify_flags(&vmi, madv_behavior->prev, vma, 168 168 range->start, range->end, new_flags);
+1 -3
mm/vma.c
··· 1650 1650 } 1651 1651 1652 1652 struct vm_area_struct 1653 - *vma_modify_flags_name(struct vma_iterator *vmi, 1653 + *vma_modify_name(struct vma_iterator *vmi, 1654 1654 struct vm_area_struct *prev, 1655 1655 struct vm_area_struct *vma, 1656 1656 unsigned long start, 1657 1657 unsigned long end, 1658 - vm_flags_t vm_flags, 1659 1658 struct anon_vma_name *new_name) 1660 1659 { 1661 1660 VMG_VMA_STATE(vmg, vmi, prev, vma, start, end); 1662 1661 1663 - vmg.vm_flags = vm_flags; 1664 1662 vmg.anon_name = new_name; 1665 1663 1666 1664 return vma_modify(&vmg);
+7 -8
mm/vma.h
··· 290 290 unsigned long start, unsigned long end, 291 291 vm_flags_t vm_flags); 292 292 293 - /* We are about to modify the VMA's flags and/or anon_name. */ 293 + /* We are about to modify the VMA's anon_name. */ 294 294 __must_check struct vm_area_struct 295 - *vma_modify_flags_name(struct vma_iterator *vmi, 296 - struct vm_area_struct *prev, 297 - struct vm_area_struct *vma, 298 - unsigned long start, 299 - unsigned long end, 300 - vm_flags_t vm_flags, 301 - struct anon_vma_name *new_name); 295 + *vma_modify_name(struct vma_iterator *vmi, 296 + struct vm_area_struct *prev, 297 + struct vm_area_struct *vma, 298 + unsigned long start, 299 + unsigned long end, 300 + struct anon_vma_name *new_name); 302 301 303 302 /* We are about to modify the VMA's memory policy. */ 304 303 __must_check struct vm_area_struct