From dc615d9223f2997b72531e4346f02baf00d2a785 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Thu, 14 Apr 2022 12:16:52 -0700 Subject: [PATCH] fixup! mm/hugetlb: Only drop uffd-wp special pte if required fix sparse warning Link: https://lkml.kernel.org/r/Ylcdw8I1L5iAoWhb@xz-m1.local Signed-off-by: Peter Xu Reported-by: kernel test robot Signed-off-by: Andrew Morton --- fs/hugetlbfs/inode.c | 2 +- include/linux/hugetlb.h | 6 +++--- mm/hugetlb.c | 6 +++--- mm/memory.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8b5b9df2be7d..c0bf65c70ade 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -405,7 +405,7 @@ static void remove_huge_page(struct page *page) static void hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end, - unsigned long zap_flags) + zap_flags_t zap_flags) { struct vm_area_struct *vma; diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9bbdd97f611a..19cec415f546 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -144,11 +144,11 @@ long follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, int *); void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long, struct page *, - unsigned long); + zap_flags_t); void __unmap_hugepage_range_final(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, - struct page *ref_page, unsigned long zap_flags); + struct page *ref_page, zap_flags_t zap_flags); void hugetlb_report_meminfo(struct seq_file *); int hugetlb_report_node_meminfo(char *buf, int len, int nid); void hugetlb_show_meminfo(void); @@ -408,7 +408,7 @@ static inline unsigned long hugetlb_change_protection( static inline void __unmap_hugepage_range_final(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, - unsigned long zap_flags) + zap_flags_t zap_flags) { BUG(); } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 33c768776edb..0b19f3158dc6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4962,7 +4962,7 @@ int move_hugetlb_page_tables(struct vm_area_struct *vma, static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, - struct page *ref_page, unsigned long zap_flags) + struct page *ref_page, zap_flags_t zap_flags) { struct mm_struct *mm = vma->vm_mm; unsigned long address; @@ -5096,7 +5096,7 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct void __unmap_hugepage_range_final(struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, - unsigned long zap_flags) + zap_flags_t zap_flags) { __unmap_hugepage_range(tlb, vma, start, end, ref_page, zap_flags); @@ -5115,7 +5115,7 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb, void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, - unsigned long zap_flags) + zap_flags_t zap_flags) { struct mmu_gather tlb; diff --git a/mm/memory.c b/mm/memory.c index b91989cc3a94..25b5f1bc3a22 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1684,7 +1684,7 @@ static void unmap_single_vma(struct mmu_gather *tlb, * safe to do nothing in this case. */ if (vma->vm_file) { - unsigned long zap_flags = details ? + zap_flags_t zap_flags = details ? details->zap_flags : 0; i_mmap_lock_write(vma->vm_file->f_mapping); __unmap_hugepage_range_final(tlb, vma, start, end, -- 2.50.1