diff --git a/include/linux/mm.h b/include/linux/mm.h index 1581b7bc25e7..836deddfa733 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1749,14 +1749,14 @@ extern int fixup_user_fault(struct mm_struct *mm, bool *unlocked); #ifdef CONFIG_SPECULATIVE_PAGE_FAULT -extern int __handle_speculative_fault(struct mm_struct *mm, - unsigned long address, - unsigned int flags, - struct vm_area_struct **vma); -static inline int handle_speculative_fault(struct mm_struct *mm, - unsigned long address, - unsigned int flags, - struct vm_area_struct **vma) +extern vm_fault_t __handle_speculative_fault(struct mm_struct *mm, + unsigned long address, + unsigned int flags, + struct vm_area_struct **vma); +static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm, + unsigned long address, + unsigned int flags, + struct vm_area_struct **vma) { /* * Try speculative page fault for multithreaded user space task only. @@ -1770,10 +1770,10 @@ static inline int handle_speculative_fault(struct mm_struct *mm, extern bool can_reuse_spf_vma(struct vm_area_struct *vma, unsigned long address); #else -static inline int handle_speculative_fault(struct mm_struct *mm, - unsigned long address, - unsigned int flags, - struct vm_area_struct **vma) +static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm, + unsigned long address, + unsigned int flags, + struct vm_area_struct **vma) { return VM_FAULT_RETRY; } diff --git a/mm/memory.c b/mm/memory.c index 1d46609c4597..6145a2b10d51 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4841,8 +4841,9 @@ static inline void mm_account_fault(struct pt_regs *regs, * This is needed as the returned vma is kept in memory until the call to * can_reuse_spf_vma() is made. */ -int __handle_speculative_fault(struct mm_struct *mm, unsigned long address, - unsigned int flags, struct vm_area_struct **vma) +vm_fault_t __handle_speculative_fault(struct mm_struct *mm, + unsigned long address, unsigned int flags, + struct vm_area_struct **vma) { struct vm_fault vmf = { .address = address, @@ -4850,7 +4851,8 @@ int __handle_speculative_fault(struct mm_struct *mm, unsigned long address, pgd_t *pgd, pgdval; p4d_t *p4d, p4dval; pud_t pudval; - int seq, ret; + int seq; + vm_fault_t ret; /* Clear flags that may lead to release the mmap_sem to retry */ flags &= ~(FAULT_FLAG_ALLOW_RETRY|FAULT_FLAG_KILLABLE);