Skip to contentSkip to conversation

mm-make-mmap_region-internal.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jan 16, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: make mmap_region() internal
has been removed from the -mm tree. Its filename was
mm-make-mmap_region-internal.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Lorenzo Stoakes <[email protected]>
Subject: mm: make mmap_region() internal
Date: Thu, 2 Jan 2025 12:10:52 +0000

Now that we have removed the one user of mmap_region() outside of mm, make it internal and add it to vma.c so it can be userland tested.

This ensures that all external memory mappings are performed using the appropriate interfaces and allows us to modify memory mapping logic as we see fit.

Additionally expand test stubs to allow for the mmap_region() code to compile and be userland testable.

---

 include/linux/mm.h               |    3 -
 mm/mmap.c                        |   59 --------------------------
 mm/vma.c                         |   61 ++++++++++++++++++++++++++-
 mm/vma.h                         |    2 
 tools/testing/vma/vma_internal.h |   65 +++++++++++++++++++++++++++++
 5 files changed, 126 insertions(+), 64 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-make-mmap_region-internal +0 -3
@@ -3363,9 +3363,6 @@ get_unmapped_area(struct file *file, uns
 	return __get_unmapped_area(file, addr, len, pgoff, flags, 0);
 }
 
-extern unsigned long mmap_region(struct file *file, unsigned long addr,
-	unsigned long len, vm_flags_t vm_flags, unsigned long pgoff,
-	struct list_head *uf);
 extern unsigned long do_mmap(struct file *file, unsigned long addr,
 	unsigned long len, unsigned long prot, unsigned long flags,
 	vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate,
mm/mmap.c renamed from mm/mmap.c~mm-make-mmap_region-internal +0 -59

65 lines not on this page · raw message

mm/vma.c renamed from mm/vma.c~mm-make-mmap_region-internal +60 -1

73 lines not on this page · raw message

mm/vma.h renamed from mm/vma.h~mm-make-mmap_region-internal +1 -1
@@ -241,7 +241,7 @@ bool vma_wants_writenotify(struct vm_are
 int mm_take_all_locks(struct mm_struct *mm);
 void mm_drop_all_locks(struct mm_struct *mm);
 
-unsigned long __mmap_region(struct file *file, unsigned long addr,
+unsigned long mmap_region(struct file *file, unsigned long addr,
 		unsigned long len, vm_flags_t vm_flags, unsigned long pgoff,
 		struct list_head *uf);
 
tools/testing/vma/vma_internal.h renamed from tools/testing/vma/vma_internal.h~mm-make-mmap_region-internal +65 -0

81 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are