diff options
author | Javier Martinez Canillas <martinez.javier@gmail.com> | 2011-01-03 20:51:57 +0100 |
---|---|---|
committer | Javier Martinez Canillas <martinez.javier@gmail.com> | 2011-01-08 00:56:50 +0100 |
commit | 87d437abf4974520392ad441f70b4f8eba3b4b3e (patch) | |
tree | 442fddf47e7d01cbf6e249672320e3d38ab5572e | |
parent | dc39c62c3d7b4dfe4958e67e65e6e4c0f085b054 (diff) | |
download | ldd3-87d437abf4974520392ad441f70b4f8eba3b4b3e.tar.gz |
simple: Change to new page fault API
-rw-r--r-- | simple/simple.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/simple/simple.c b/simple/simple.c index 1c286dd..e3bf01e 100644 --- a/simple/simple.c +++ b/simple/simple.c @@ -98,12 +98,11 @@ static int simple_remap_mmap(struct file *filp, struct vm_area_struct *vma) /* * The nopage version. */ -struct page *simple_vma_nopage(struct vm_area_struct *vma, - unsigned long address, int *type) +static int simple_vma_nopage(struct vm_area_struct *vma, struct vm_fault *vmf) { struct page *pageptr; unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; - unsigned long physaddr = address - vma->vm_start + offset; + unsigned long physaddr = (unsigned long) vmf->virtual_address - vma->vm_start + offset; unsigned long pageframe = physaddr >> PAGE_SHIFT; // Eventually remove these printks @@ -116,9 +115,9 @@ struct page *simple_vma_nopage(struct vm_area_struct *vma, printk (KERN_NOTICE "page->index = %ld mapping %p\n", pageptr->index, pageptr->mapping); printk (KERN_NOTICE "Page frame %ld\n", pageframe); get_page(pageptr); - if (type) - *type = VM_FAULT_MINOR; - return pageptr; + vmf->page = pageptr; + + return 0; } static struct vm_operations_struct simple_nopage_vm_ops = { |