From 177f8d40962ce3248ae7827ed13f0ff698576fe6 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 10 May 2022 17:47:10 -0700 Subject: [PATCH] mapletree: build fix Fix the vma_mas_store/vma_mas_remove issues. Missing prototypes, missing implementation on nommu. Cc: "Liam R. Howlett" Cc: Stephen Rothwell Signed-off-by: Andrew Morton --- include/linux/mm.h | 3 +++ mm/mmap.c | 4 ++-- mm/nommu.c | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index d42dc897a913..ad9f71579756 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2639,6 +2639,9 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **, bool *need_rmap_locks); extern void exit_mmap(struct mm_struct *); +void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas); +void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas); + static inline int check_data_rlimit(unsigned long rlim, unsigned long new, unsigned long start, diff --git a/mm/mmap.c b/mm/mmap.c index e777da0132f6..9d97688e21be 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -754,7 +754,7 @@ static void __vma_link_file(struct vm_area_struct *vma) * * Note: the end address is inclusive in the maple tree. */ -inline void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas) +void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas) { trace_vma_store(mas->tree, vma); mas_set_range(mas, vma->vm_start, vma->vm_end - 1); @@ -770,7 +770,7 @@ inline void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas) * been established and points to the correct location. * Note: the end address is inclusive in the maple tree. */ -static inline void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas) +void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas) { trace_vma_mas_szero(mas->tree, vma->vm_start, vma->vm_end - 1); mas->index = vma->vm_start; diff --git a/mm/nommu.c b/mm/nommu.c index 9d7afc2d959e..5af0b050eba8 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -545,6 +545,19 @@ static void put_nommu_region(struct vm_region *region) __put_nommu_region(region); } +void vma_mas_store(struct vm_area_struct *vma, struct ma_state *mas) +{ + mas_set_range(mas, vma->vm_start, vma->vm_end - 1); + mas_store_prealloc(mas, vma); +} + +void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas) +{ + mas->index = vma->vm_start; + mas->last = vma->vm_end - 1; + mas_store_prealloc(mas, NULL); +} + /* * add a VMA into a process's mm_struct in the appropriate place in the list * and tree and add to the address space's page tree also if not an anonymous -- 2.50.1