* [merged mm-stable] mm-add-vma-iterator-to-vma_adjust-arguments.patch removed from -mm tree
@ 2023-02-10 0:53 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-02-10 0:53 UTC (permalink / raw)
To: mm-commits, Liam.Howlett, Liam.Howlett, akpm
The quilt patch titled
Subject: mm: add vma iterator to vma_adjust() arguments
has been removed from the -mm tree. Its filename was
mm-add-vma-iterator-to-vma_adjust-arguments.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: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
Subject: mm: add vma iterator to vma_adjust() arguments
Date: Fri, 20 Jan 2023 11:26:37 -0500
Change the vma_adjust() function definition to accept the vma iterator and
pass it through to __vma_adjust().
Update fs/exec to use the new vma_adjust() function parameters.
Update mm/mremap to use the new vma_adjust() function parameters.
Revert the __split_vma() calls back from __vma_adjust() to vma_adjust()
and pass through the vma iterator.
Link: https://lkml.kernel.org/r/20230120162650.984577-37-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/exec.c | 11 ++++-------
include/linux/mm.h | 9 ++++-----
mm/mmap.c | 10 +++++-----
mm/mremap.c | 4 ++--
4 files changed, 15 insertions(+), 19 deletions(-)
--- a/fs/exec.c~mm-add-vma-iterator-to-vma_adjust-arguments
+++ a/fs/exec.c
@@ -699,7 +699,7 @@ static int shift_arg_pages(struct vm_are
/*
* cover the whole range: [new_start, old_end)
*/
- if (vma_adjust(vma, new_start, old_end, vma->vm_pgoff, NULL))
+ if (vma_adjust(&vmi, vma, new_start, old_end, vma->vm_pgoff, NULL))
return -ENOMEM;
/*
@@ -731,12 +731,9 @@ static int shift_arg_pages(struct vm_are
}
tlb_finish_mmu(&tlb);
- /*
- * Shrink the vma to just the new range. Always succeeds.
- */
- vma_adjust(vma, new_start, new_end, vma->vm_pgoff, NULL);
-
- return 0;
+ vma_prev(&vmi);
+ /* Shrink the vma to just the new range */
+ return vma_adjust(&vmi, vma, new_start, new_end, vma->vm_pgoff, NULL);
}
/*
--- a/include/linux/mm.h~mm-add-vma-iterator-to-vma_adjust-arguments
+++ a/include/linux/mm.h
@@ -2834,12 +2834,11 @@ extern int __vm_enough_memory(struct mm_
extern int __vma_adjust(struct vma_iterator *vmi, struct vm_area_struct *vma, unsigned long start,
unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert,
struct vm_area_struct *expand);
-static inline int vma_adjust(struct vm_area_struct *vma, unsigned long start,
- unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert)
+static inline int vma_adjust(struct vma_iterator *vmi,
+ struct vm_area_struct *vma, unsigned long start, unsigned long end,
+ pgoff_t pgoff, struct vm_area_struct *insert)
{
- VMA_ITERATOR(vmi, vma->vm_mm, start);
-
- return __vma_adjust(&vmi, vma, start, end, pgoff, insert, NULL);
+ return __vma_adjust(vmi, vma, start, end, pgoff, insert, NULL);
}
extern struct vm_area_struct *vma_merge(struct vma_iterator *vmi,
struct mm_struct *, struct vm_area_struct *prev, unsigned long addr,
--- a/mm/mmap.c~mm-add-vma-iterator-to-vma_adjust-arguments
+++ a/mm/mmap.c
@@ -2210,12 +2210,12 @@ int __split_vma(struct vma_iterator *vmi
new->vm_ops->open(new);
if (new_below)
- err = __vma_adjust(vmi, vma, addr, vma->vm_end,
- vma->vm_pgoff + ((addr - new->vm_start) >> PAGE_SHIFT),
- new, NULL);
+ err = vma_adjust(vmi, vma, addr, vma->vm_end,
+ vma->vm_pgoff + ((addr - new->vm_start) >> PAGE_SHIFT),
+ new);
else
- err = __vma_adjust(vmi, vma, vma->vm_start, addr, vma->vm_pgoff,
- new, NULL);
+ err = vma_adjust(vmi, vma, vma->vm_start, addr, vma->vm_pgoff,
+ new);
/* Success. */
if (!err) {
--- a/mm/mremap.c~mm-add-vma-iterator-to-vma_adjust-arguments
+++ a/mm/mremap.c
@@ -1047,8 +1047,8 @@ SYSCALL_DEFINE5(mremap, unsigned long, a
extension_end, vma->vm_flags, vma->anon_vma,
vma->vm_file, extension_pgoff, vma_policy(vma),
vma->vm_userfaultfd_ctx, anon_vma_name(vma));
- } else if (vma_adjust(vma, vma->vm_start, addr + new_len,
- vma->vm_pgoff, NULL)) {
+ } else if (vma_adjust(&vmi, vma, vma->vm_start,
+ addr + new_len, vma->vm_pgoff, NULL)) {
vma = NULL;
}
if (!vma) {
_
Patches currently in -mm which might be from Liam.Howlett@Oracle.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-10 0:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 0:53 [merged mm-stable] mm-add-vma-iterator-to-vma_adjust-arguments.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.