summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLiam R. Howlett <Liam.Howlett@Oracle.com>2023-01-20 19:26:46 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-02-10 03:51:38 +0300
commitcf51e86dfbe39b7cae3a9de650d035af22dd5fb4 (patch)
tree9d21cd52be3e64b5cada32f2001368af48c9039a /include
parent7c9813e886bb52495ff5b97d4b0f1320d36d869b (diff)
downloadlinux-cf51e86dfbe39b7cae3a9de650d035af22dd5fb4.tar.xz
mm/mmap: don't use __vma_adjust() in shift_arg_pages()
Introduce shrink_vma() which uses the vma_prepare() and vma_complete() functions to reduce the vma coverage. Convert shift_arg_pages() to use expand_vma() and the new shrink_vma() function. Remove support from __vma_adjust() to reduce a vma size since shift_arg_pages() is the only user that shrinks a VMA in this way. Link: https://lkml.kernel.org/r/20230120162650.984577-46-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 245fb30858c9..dcc34533d2f6 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2831,17 +2831,11 @@ void anon_vma_interval_tree_verify(struct anon_vma_chain *node);
/* mmap.c */
extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
-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 *expand);
-static inline int vma_adjust(struct vma_iterator *vmi,
- struct vm_area_struct *vma, unsigned long start, unsigned long end,
- pgoff_t pgoff)
-{
- return __vma_adjust(vmi, vma, start, end, pgoff, NULL);
-}
extern int vma_expand(struct vma_iterator *vmi, struct vm_area_struct *vma,
unsigned long start, unsigned long end, pgoff_t pgoff,
struct vm_area_struct *next);
+extern int vma_shrink(struct vma_iterator *vmi, struct vm_area_struct *vma,
+ unsigned long start, unsigned long end, pgoff_t pgoff);
extern struct vm_area_struct *vma_merge(struct vma_iterator *vmi,
struct mm_struct *, struct vm_area_struct *prev, unsigned long addr,
unsigned long end, unsigned long vm_flags, struct anon_vma *,