Commit 3c18ddd160d1fcd46d1131d9ad6c594dd8e9af99
Committed by
Linus Torvalds
1 parent
4d3d5b41a7
Exists in
master
and in
4 other branches
mm: remove nopage
Nothing in the tree uses nopage any more. Remove support for it in the core mm code and documentation (and a few stray references to it in comments). Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 9 changed files with 11 additions and 43 deletions Side-by-side Diff
Documentation/feature-removal-schedule.txt
... | ... | @@ -128,15 +128,6 @@ |
128 | 128 | |
129 | 129 | --------------------------- |
130 | 130 | |
131 | -What: vm_ops.nopage | |
132 | -When: Soon, provided in-kernel callers have been converted | |
133 | -Why: This interface is replaced by vm_ops.fault, but it has been around | |
134 | - forever, is used by a lot of drivers, and doesn't cost much to | |
135 | - maintain. | |
136 | -Who: Nick Piggin <npiggin@suse.de> | |
137 | - | |
138 | ---------------------------- | |
139 | - | |
140 | 131 | What: PHYSDEVPATH, PHYSDEVBUS, PHYSDEVDRIVER in the uevent environment |
141 | 132 | When: October 2008 |
142 | 133 | Why: The stacking of class devices makes these values misleading and |
Documentation/filesystems/Locking
... | ... | @@ -511,7 +511,6 @@ |
511 | 511 | void (*open)(struct vm_area_struct*); |
512 | 512 | void (*close)(struct vm_area_struct*); |
513 | 513 | int (*fault)(struct vm_area_struct*, struct vm_fault *); |
514 | - struct page *(*nopage)(struct vm_area_struct*, unsigned long, int *); | |
515 | 514 | int (*page_mkwrite)(struct vm_area_struct *, struct page *); |
516 | 515 | |
517 | 516 | locking rules: |
... | ... | @@ -519,7 +518,6 @@ |
519 | 518 | open: no yes |
520 | 519 | close: no yes |
521 | 520 | fault: no yes |
522 | -nopage: no yes | |
523 | 521 | page_mkwrite: no yes no |
524 | 522 | |
525 | 523 | ->page_mkwrite() is called when a previously read-only page is |
... | ... | @@ -537,5 +535,4 @@ |
537 | 535 | |
538 | 536 | ipc/shm.c::shm_delete() - may need BKL. |
539 | 537 | ->read() and ->write() in many drivers are (probably) missing BKL. |
540 | -drivers/sgi/char/graphics.c::sgi_graphics_nopage() - may need BKL. |
drivers/media/video/vino.c
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | /* |
14 | 14 | * TODO: |
15 | 15 | * - remove "mark pages reserved-hacks" from memory allocation code |
16 | - * and implement nopage() | |
16 | + * and implement fault() | |
17 | 17 | * - check decimation, calculating and reporting image size when |
18 | 18 | * using decimation |
19 | 19 | * - implement read(), user mode buffers and overlay (?) |
drivers/video/vermilion/vermilion.c
... | ... | @@ -112,8 +112,9 @@ |
112 | 112 | |
113 | 113 | /* |
114 | 114 | * It seems like __get_free_pages only ups the usage count |
115 | - * of the first page. This doesn't work with nopage mapping, so | |
116 | - * up the usage count once more. | |
115 | + * of the first page. This doesn't work with fault mapping, so | |
116 | + * up the usage count once more (XXX: should use split_page or | |
117 | + * compound page). | |
117 | 118 | */ |
118 | 119 | |
119 | 120 | memset((void *)va->logical, 0x00, va->size); |
fs/gfs2/ops_address.c
... | ... | @@ -438,7 +438,7 @@ |
438 | 438 | int error; |
439 | 439 | |
440 | 440 | /* |
441 | - * Due to the order of unstuffing files and ->nopage(), we can be | |
441 | + * Due to the order of unstuffing files and ->fault(), we can be | |
442 | 442 | * asked for a zero page in the case of a stuffed file being extended, |
443 | 443 | * so we need to supply one here. It doesn't happen often. |
444 | 444 | */ |
include/linux/mm.h
... | ... | @@ -164,8 +164,6 @@ |
164 | 164 | void (*open)(struct vm_area_struct * area); |
165 | 165 | void (*close)(struct vm_area_struct * area); |
166 | 166 | int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf); |
167 | - struct page *(*nopage)(struct vm_area_struct *area, | |
168 | - unsigned long address, int *type); | |
169 | 167 | unsigned long (*nopfn)(struct vm_area_struct *area, |
170 | 168 | unsigned long address); |
171 | 169 | |
... | ... | @@ -647,12 +645,6 @@ |
647 | 645 | { |
648 | 646 | return atomic_read(&(page)->_mapcount) >= 0; |
649 | 647 | } |
650 | - | |
651 | -/* | |
652 | - * Error return values for the *_nopage functions | |
653 | - */ | |
654 | -#define NOPAGE_SIGBUS (NULL) | |
655 | -#define NOPAGE_OOM ((struct page *) (-1)) | |
656 | 648 | |
657 | 649 | /* |
658 | 650 | * Error return values for the *_nopfn functions |
mm/memory.c
... | ... | @@ -1057,8 +1057,7 @@ |
1057 | 1057 | if (pages) |
1058 | 1058 | foll_flags |= FOLL_GET; |
1059 | 1059 | if (!write && !(vma->vm_flags & VM_LOCKED) && |
1060 | - (!vma->vm_ops || (!vma->vm_ops->nopage && | |
1061 | - !vma->vm_ops->fault))) | |
1060 | + (!vma->vm_ops || !vma->vm_ops->fault)) | |
1062 | 1061 | foll_flags |= FOLL_ANON; |
1063 | 1062 | |
1064 | 1063 | do { |
... | ... | @@ -2199,20 +2198,9 @@ |
2199 | 2198 | |
2200 | 2199 | BUG_ON(vma->vm_flags & VM_PFNMAP); |
2201 | 2200 | |
2202 | - if (likely(vma->vm_ops->fault)) { | |
2203 | - ret = vma->vm_ops->fault(vma, &vmf); | |
2204 | - if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) | |
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 | - } | |
2201 | + ret = vma->vm_ops->fault(vma, &vmf); | |
2202 | + if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE))) | |
2203 | + return ret; | |
2216 | 2204 | |
2217 | 2205 | /* |
2218 | 2206 | * For consistency in subsequent calls, make the faulted page always |
... | ... | @@ -2458,7 +2446,7 @@ |
2458 | 2446 | if (!pte_present(entry)) { |
2459 | 2447 | if (pte_none(entry)) { |
2460 | 2448 | if (vma->vm_ops) { |
2461 | - if (vma->vm_ops->fault || vma->vm_ops->nopage) | |
2449 | + if (likely(vma->vm_ops->fault)) | |
2462 | 2450 | return do_linear_fault(mm, vma, address, |
2463 | 2451 | pte, pmd, write_access, entry); |
2464 | 2452 | if (unlikely(vma->vm_ops->nopfn)) |
mm/mincore.c
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | * When tmpfs swaps out a page from a file, any process mapping that |
34 | 34 | * file will not get a swp_entry_t in its pte, but rather it is like |
35 | 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 | 38 | * However when tmpfs moves the page from pagecache and into swapcache, |
39 | 39 | * it is still in core, but the find_get_page below won't find it. |
mm/rmap.c
... | ... | @@ -662,7 +662,6 @@ |
662 | 662 | printk (KERN_EMERG " page->mapping = %p\n", page->mapping); |
663 | 663 | print_symbol (KERN_EMERG " vma->vm_ops = %s\n", (unsigned long)vma->vm_ops); |
664 | 664 | if (vma->vm_ops) { |
665 | - print_symbol (KERN_EMERG " vma->vm_ops->nopage = %s\n", (unsigned long)vma->vm_ops->nopage); | |
666 | 665 | print_symbol (KERN_EMERG " vma->vm_ops->fault = %s\n", (unsigned long)vma->vm_ops->fault); |
667 | 666 | } |
668 | 667 | if (vma->vm_file && vma->vm_file->f_op) |