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-03 20:51:57 +0100 |
commit | 8e0b2221d6ba3f04483e4afadc4b99a6f39f1c59 (patch) | |
tree | 67d964f9aeffe176b2f15c6d2a791e946f56a5b1 | |
parent | 2ec2ee9be5335054c975bcee9407964ee7db7686 (diff) | |
download | ldd3-8e0b2221d6ba3f04483e4afadc4b99a6f39f1c59.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 = { |