Skip to content

Commit b3ec9f3

Browse files
Souptick Joardertorvalds
authored andcommitted
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 1c8f422 ("mm: change return type to vm_fault_t") Link: http://lkml.kernel.org/r/20180512063745.GA26866@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder <[email protected]> Reviewed-by: Matthew Wilcox <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Joe Perches <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Dan Williams <[email protected]> Cc: David Rientjes <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2bcd645 commit b3ec9f3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/linux/mm_types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ struct vm_special_mapping {
629629
* If non-NULL, then this is called to resolve page faults
630630
* on the special mapping. If used, .pages is not checked.
631631
*/
632-
int (*fault)(const struct vm_special_mapping *sm,
633-
struct vm_area_struct *vma,
634-
struct vm_fault *vmf);
632+
vm_fault_t (*fault)(const struct vm_special_mapping *sm,
633+
struct vm_area_struct *vma,
634+
struct vm_fault *vmf);
635635

636636
int (*mremap)(const struct vm_special_mapping *sm,
637637
struct vm_area_struct *new_vma);

mm/hugetlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3159,7 +3159,7 @@ static unsigned long hugetlb_vm_op_pagesize(struct vm_area_struct *vma)
31593159
* hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get
31603160
* this far.
31613161
*/
3162-
static int hugetlb_vm_op_fault(struct vm_fault *vmf)
3162+
static vm_fault_t hugetlb_vm_op_fault(struct vm_fault *vmf)
31633163
{
31643164
BUG();
31653165
return 0;

mm/mmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3277,7 +3277,7 @@ void vm_stat_account(struct mm_struct *mm, vm_flags_t flags, long npages)
32773277
mm->data_vm += npages;
32783278
}
32793279

3280-
static int special_mapping_fault(struct vm_fault *vmf);
3280+
static vm_fault_t special_mapping_fault(struct vm_fault *vmf);
32813281

32823282
/*
32833283
* Having a close hook prevents vma merging regardless of flags.
@@ -3316,7 +3316,7 @@ static const struct vm_operations_struct legacy_special_mapping_vmops = {
33163316
.fault = special_mapping_fault,
33173317
};
33183318

3319-
static int special_mapping_fault(struct vm_fault *vmf)
3319+
static vm_fault_t special_mapping_fault(struct vm_fault *vmf)
33203320
{
33213321
struct vm_area_struct *vma = vmf->vma;
33223322
pgoff_t pgoff;

0 commit comments

Comments
 (0)