Commit 7c9813e8 authored by Liam R. Howlett's avatar Liam R. Howlett Committed by Andrew Morton

mm/mremap: convert vma_adjust() to vma_expand()

Stop using vma_adjust() in preparation for removing the function.  Export
vma_expand() to use instead.

Link: https://lkml.kernel.org/r/20230120162650.984577-45-Liam.Howlett@oracle.comSigned-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent b2b3b886
...@@ -2839,6 +2839,9 @@ static inline int vma_adjust(struct vma_iterator *vmi, ...@@ -2839,6 +2839,9 @@ static inline int vma_adjust(struct vma_iterator *vmi,
{ {
return __vma_adjust(vmi, vma, start, end, pgoff, NULL); 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 struct vm_area_struct *vma_merge(struct vma_iterator *vmi, extern struct vm_area_struct *vma_merge(struct vma_iterator *vmi,
struct mm_struct *, struct vm_area_struct *prev, unsigned long addr, struct mm_struct *, struct vm_area_struct *prev, unsigned long addr,
unsigned long end, unsigned long vm_flags, struct anon_vma *, unsigned long end, unsigned long vm_flags, struct anon_vma *,
......
...@@ -634,9 +634,9 @@ static inline void vma_complete(struct vma_prepare *vp, ...@@ -634,9 +634,9 @@ static inline void vma_complete(struct vma_prepare *vp,
* *
* Returns: 0 on success * Returns: 0 on success
*/ */
inline int vma_expand(struct vma_iterator *vmi, struct vm_area_struct *vma, int vma_expand(struct vma_iterator *vmi, struct vm_area_struct *vma,
unsigned long start, unsigned long end, pgoff_t pgoff, unsigned long start, unsigned long end, pgoff_t pgoff,
struct vm_area_struct *next) struct vm_area_struct *next)
{ {
bool remove_next = false; bool remove_next = false;
struct vma_prepare vp; struct vma_prepare vp;
......
...@@ -1053,8 +1053,8 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, ...@@ -1053,8 +1053,8 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
extension_end, vma->vm_flags, vma->anon_vma, extension_end, vma->vm_flags, vma->anon_vma,
vma->vm_file, extension_pgoff, vma_policy(vma), vma->vm_file, extension_pgoff, vma_policy(vma),
vma->vm_userfaultfd_ctx, anon_vma_name(vma)); vma->vm_userfaultfd_ctx, anon_vma_name(vma));
} else if (vma_adjust(&vmi, vma, vma->vm_start, } else if (vma_expand(&vmi, vma, vma->vm_start,
addr + new_len, vma->vm_pgoff)) { addr + new_len, vma->vm_pgoff, NULL)) {
vma = NULL; vma = NULL;
} }
if (!vma) { if (!vma) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment