diff options
-rw-r--r-- | include/linux/mm.h | 1 | ||||
-rw-r--r-- | mm/memory.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 903f3b71f4a7..a0eec16eb0bd 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -637,6 +637,7 @@ static inline int page_mapped(struct page *page) | |||
637 | */ | 637 | */ |
638 | #define NOPFN_SIGBUS ((unsigned long) -1) | 638 | #define NOPFN_SIGBUS ((unsigned long) -1) |
639 | #define NOPFN_OOM ((unsigned long) -2) | 639 | #define NOPFN_OOM ((unsigned long) -2) |
640 | #define NOPFN_REFAULT ((unsigned long) -3) | ||
640 | 641 | ||
641 | /* | 642 | /* |
642 | * Different kinds of faults, as returned by handle_mm_fault(). | 643 | * Different kinds of faults, as returned by handle_mm_fault(). |
diff --git a/mm/memory.c b/mm/memory.c index 8b8f0d2b453d..e7066e71dfa3 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2355,10 +2355,12 @@ static noinline int do_no_pfn(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2355 | BUG_ON(is_cow_mapping(vma->vm_flags)); | 2355 | BUG_ON(is_cow_mapping(vma->vm_flags)); |
2356 | 2356 | ||
2357 | pfn = vma->vm_ops->nopfn(vma, address & PAGE_MASK); | 2357 | pfn = vma->vm_ops->nopfn(vma, address & PAGE_MASK); |
2358 | if (pfn == NOPFN_OOM) | 2358 | if (unlikely(pfn == NOPFN_OOM)) |
2359 | return VM_FAULT_OOM; | 2359 | return VM_FAULT_OOM; |
2360 | if (pfn == NOPFN_SIGBUS) | 2360 | else if (unlikely(pfn == NOPFN_SIGBUS)) |
2361 | return VM_FAULT_SIGBUS; | 2361 | return VM_FAULT_SIGBUS; |
2362 | else if (unlikely(pfn == NOPFN_REFAULT)) | ||
2363 | return VM_FAULT_MINOR; | ||
2362 | 2364 | ||
2363 | page_table = pte_offset_map_lock(mm, pmd, address, &ptl); | 2365 | page_table = pte_offset_map_lock(mm, pmd, address, &ptl); |
2364 | 2366 | ||