aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c22
-rw-r--r--mm/mincore.c2
-rw-r--r--mm/rmap.c1
3 files changed, 6 insertions, 19 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 0d14d1e58a5f..46958fb97c2d 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1057,8 +1057,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1057 if (pages) 1057 if (pages)
1058 foll_flags |= FOLL_GET; 1058 foll_flags |= FOLL_GET;
1059 if (!write && !(vma->vm_flags & VM_LOCKED) && 1059 if (!write && !(vma->vm_flags & VM_LOCKED) &&
1060 (!vma->vm_ops || (!vma->vm_ops->nopage && 1060 (!vma->vm_ops || !vma->vm_ops->fault))
1061 !vma->vm_ops->fault)))
1062 foll_flags |= FOLL_ANON; 1061 foll_flags |= FOLL_ANON;
1063 1062
1064 do { 1063 do {
@@ -2199,20 +2198,9 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2199 2198
2200 BUG_ON(vma->vm_flags & VM_PFNMAP); 2199 BUG_ON(vma->vm_flags & VM_PFNMAP);
2201 2200
2202 if (likely(vma->vm_ops->fault)) { 2201 ret = vma->vm_ops->fault(vma, &vmf);
2203 ret = vma->vm_ops->fault(vma, &vmf); 2202 if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))
2204 if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) 2203 return ret;
2205 return ret;
2206 } else {
2207 /* Legacy ->nopage path */
2208 ret = 0;
2209 vmf.page = vma->vm_ops->nopage(vma, address & PAGE_MASK, &ret);
2210 /* no page was available -- either SIGBUS or OOM */
2211 if (unlikely(vmf.page == NOPAGE_SIGBUS))
2212 return VM_FAULT_SIGBUS;
2213 else if (unlikely(vmf.page == NOPAGE_OOM))
2214 return VM_FAULT_OOM;
2215 }
2216 2204
2217 /* 2205 /*
2218 * For consistency in subsequent calls, make the faulted page always 2206 * For consistency in subsequent calls, make the faulted page always
@@ -2458,7 +2446,7 @@ static inline int handle_pte_fault(struct mm_struct *mm,
2458 if (!pte_present(entry)) { 2446 if (!pte_present(entry)) {
2459 if (pte_none(entry)) { 2447 if (pte_none(entry)) {
2460 if (vma->vm_ops) { 2448 if (vma->vm_ops) {
2461 if (vma->vm_ops->fault || vma->vm_ops->nopage) 2449 if (likely(vma->vm_ops->fault))
2462 return do_linear_fault(mm, vma, address, 2450 return do_linear_fault(mm, vma, address,
2463 pte, pmd, write_access, entry); 2451 pte, pmd, write_access, entry);
2464 if (unlikely(vma->vm_ops->nopfn)) 2452 if (unlikely(vma->vm_ops->nopfn))
diff --git a/mm/mincore.c b/mm/mincore.c
index 5efe0ded69b1..5178800bc129 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -33,7 +33,7 @@ static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff)
33 * When tmpfs swaps out a page from a file, any process mapping that 33 * When tmpfs swaps out a page from a file, any process mapping that
34 * file will not get a swp_entry_t in its pte, but rather it is like 34 * file will not get a swp_entry_t in its pte, but rather it is like
35 * any other file mapping (ie. marked !present and faulted in with 35 * any other file mapping (ie. marked !present and faulted in with
36 * tmpfs's .nopage). So swapped out tmpfs mappings are tested here. 36 * tmpfs's .fault). So swapped out tmpfs mappings are tested here.
37 * 37 *
38 * However when tmpfs moves the page from pagecache and into swapcache, 38 * However when tmpfs moves the page from pagecache and into swapcache,
39 * it is still in core, but the find_get_page below won't find it. 39 * it is still in core, but the find_get_page below won't find it.
diff --git a/mm/rmap.c b/mm/rmap.c
index e9bb6b1093f6..bf0a5b7cfb8e 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -662,7 +662,6 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma)
662 printk (KERN_EMERG " page->mapping = %p\n", page->mapping); 662 printk (KERN_EMERG " page->mapping = %p\n", page->mapping);
663 print_symbol (KERN_EMERG " vma->vm_ops = %s\n", (unsigned long)vma->vm_ops); 663 print_symbol (KERN_EMERG " vma->vm_ops = %s\n", (unsigned long)vma->vm_ops);
664 if (vma->vm_ops) { 664 if (vma->vm_ops) {
665 print_symbol (KERN_EMERG " vma->vm_ops->nopage = %s\n", (unsigned long)vma->vm_ops->nopage);
666 print_symbol (KERN_EMERG " vma->vm_ops->fault = %s\n", (unsigned long)vma->vm_ops->fault); 665 print_symbol (KERN_EMERG " vma->vm_ops->fault = %s\n", (unsigned long)vma->vm_ops->fault);
667 } 666 }
668 if (vma->vm_file && vma->vm_file->f_op) 667 if (vma->vm_file && vma->vm_file->f_op)