summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <martinez.javier@gmail.com>2011-01-03 20:16:48 +0100
committerJavier Martinez Canillas <martinez.javier@gmail.com>2011-01-08 00:40:48 +0100
commit1f431a05e0d2843a8ff4d950c7b2120a83edb804 (patch)
tree12a63da06af892be9a1a692ae76e5bd726214ff5
parente5e8b383adc8a7a10831188694e41ae383852ec5 (diff)
downloadldd3-1f431a05e0d2843a8ff4d950c7b2120a83edb804.tar.gz
sculld: Change to new page fault API
-rw-r--r--sculld/mmap.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sculld/mmap.c b/sculld/mmap.c
index 4c7341d..45a1274 100644
--- a/sculld/mmap.c
+++ b/sculld/mmap.c
@@ -56,16 +56,16 @@ void sculld_vma_close(struct vm_area_struct *vma)
* is individually decreased, and would drop to 0.
*/
-struct page *sculld_vma_nopage(struct vm_area_struct *vma,
- unsigned long address, int *type)
+static int sculld_vma_nopage(struct vm_area_struct *vma, struct vm_fault *vmf)
{
unsigned long offset;
struct sculld_dev *ptr, *dev = vma->vm_private_data;
- struct page *page = VM_FAULT_SIGBUS;
+ struct page *page = NULL;
void *pageptr = NULL; /* default to "missing" */
+ int retval = VM_FAULT_NOPAGE;
down(&dev->sem);
- offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
+ offset = (unsigned long)(vmf->virtual_address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
if (offset >= dev->size) goto out; /* out of range */
/*
@@ -83,11 +83,12 @@ struct page *sculld_vma_nopage(struct vm_area_struct *vma,
/* got it, now increment the count */
get_page(page);
- if (type)
- *type = VM_FAULT_MINOR;
+ vmf->page = page;
+ retval = 0;
+
out:
up(&dev->sem);
- return page;
+ return retval;
}