From 87d437abf4974520392ad441f70b4f8eba3b4b3e Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mon, 3 Jan 2011 20:51:57 +0100 Subject: simple: Change to new page fault API --- simple/simple.c | 11 +++++------ 1 file 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 = { -- cgit v1.2.1-18-gbd029