From cf0d37e347edafe72a92e7d45c2078c24ada5e42 Mon Sep 17 00:00:00 2001 From: Souptick Joarder Date: Thu, 7 Jun 2018 17:08:04 -0700 Subject: [PATCH] UPSTREAM: mm: change return type to vm_fault_t Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See commit 1c8f422059ae ("mm: change return type to vm_fault_t") Link: http://lkml.kernel.org/r/20180512063745.GA26866@jordon-HP-15-Notebook-PC Change-Id: Ib16ec7d9a34c73d98fe673b8ce6e9241ad3255b8 Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Reviewed-by: Andrew Morton Cc: Joe Perches Cc: Michal Hocko Cc: Hugh Dickins Cc: Dan Williams Cc: David Rientjes Cc: Mike Kravetz Cc: Naoya Horiguchi Cc: Aneesh Kumar K.V Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sorayukii --- include/linux/mm_types.h | 6 +++--- mm/hugetlb.c | 2 +- mm/mmap.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 82d941b0e854..af6cf896d5f4 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -614,9 +614,9 @@ struct vm_special_mapping { * If non-NULL, then this is called to resolve page faults * on the special mapping. If used, .pages is not checked. */ - int (*fault)(const struct vm_special_mapping *sm, - struct vm_area_struct *vma, - struct vm_fault *vmf); + vm_fault_t (*fault)(const struct vm_special_mapping *sm, + struct vm_area_struct *vma, + struct vm_fault *vmf); int (*mremap)(const struct vm_special_mapping *sm, struct vm_area_struct *new_vma); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 69c1194db950..0670ae640124 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3220,7 +3220,7 @@ static int hugetlb_vm_op_split(struct vm_area_struct *vma, unsigned long addr) * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get * this far. */ -static int hugetlb_vm_op_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +static vm_fault_t hugetlb_vm_op_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { BUG(); return 0; diff --git a/mm/mmap.c b/mm/mmap.c index f59d8e681725..27d5b7bf0885 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3358,7 +3358,7 @@ void vm_stat_account(struct mm_struct *mm, vm_flags_t flags, long npages) mm->data_vm += npages; } -static int special_mapping_fault(struct vm_area_struct *vma, +static vm_fault_t special_mapping_fault(struct vm_area_struct *vma, struct vm_fault *vmf); /* @@ -3394,7 +3394,7 @@ static const struct vm_operations_struct legacy_special_mapping_vmops = { .fault = special_mapping_fault, }; -static int special_mapping_fault(struct vm_area_struct *vma, +static vm_fault_t special_mapping_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { pgoff_t pgoff;