diff options
author | Nick Piggin <npiggin@suse.de> | 2007-07-19 04:47:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:41 -0400 |
commit | d0217ac04ca6591841e5665f518e38064f4e65bd (patch) | |
tree | d3309094bb734d34773f97d642593e298a5cfcfc /mm/hugetlb.c | |
parent | ed2f2f9b3ff8debdf512f7687b232c3c1d7d60d7 (diff) |
mm: fault feedback #1
Change ->fault prototype. We now return an int, which contains
VM_FAULT_xxx code in the low byte, and FAULT_RET_xxx code in the next byte.
FAULT_RET_ code tells the VM whether a page was found, whether it has been
locked, and potentially other things. This is not quite the way he wanted
it yet, but that's changed in the next patch (which requires changes to
arch code).
This means we no longer set VM_CAN_INVALIDATE in the vma in order to say
that a page is locked which requires filemap_nopage to go away (because we
can no longer remain backward compatible without that flag), but we were
going to do that anyway.
struct fault_data is renamed to struct vm_fault as Linus asked. address
is now a void __user * that we should firmly encourage drivers not to use
without really good reason.
The page is now returned via a page pointer in the vm_fault struct.
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>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6912bbf33fa..aaa7c1a682d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -316,15 +316,14 @@ unsigned long hugetlb_total_pages(void) | |||
316 | * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get | 316 | * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get |
317 | * this far. | 317 | * this far. |
318 | */ | 318 | */ |
319 | static struct page *hugetlb_nopage(struct vm_area_struct *vma, | 319 | static int hugetlb_vm_op_fault(struct vm_area_struct *vma, struct vm_fault *vmf) |
320 | unsigned long address, int *unused) | ||
321 | { | 320 | { |
322 | BUG(); | 321 | BUG(); |
323 | return NULL; | 322 | return 0; |
324 | } | 323 | } |
325 | 324 | ||
326 | struct vm_operations_struct hugetlb_vm_ops = { | 325 | struct vm_operations_struct hugetlb_vm_ops = { |
327 | .nopage = hugetlb_nopage, | 326 | .fault = hugetlb_vm_op_fault, |
328 | }; | 327 | }; |
329 | 328 | ||
330 | static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, | 329 | static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, |