summaryrefslogtreecommitdiffstats
path: root/drivers/uio/uio.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2008-02-06 01:37:35 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 10:41:07 -0800
commita18b630d1becdf1a087de644fea080c1977bcf10 (patch)
tree1972b084c14bfe46eeba0c05270aa45b3225619c /drivers/uio/uio.c
parenta1e096129bff79ae551592539bef19bfb5c9efa1 (diff)
downloadlinux-a18b630d1becdf1a087de644fea080c1977bcf10.tar.gz
linux-a18b630d1becdf1a087de644fea080c1977bcf10.tar.bz2
linux-a18b630d1becdf1a087de644fea080c1977bcf10.zip
uio: nopage
Convert uio from nopage to fault. Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: Hans J Koch <hjk@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/uio/uio.c')
-rw-r--r--drivers/uio/uio.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index cc246faa3590..2a77e9d42c68 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -417,30 +417,28 @@ static void uio_vma_close(struct vm_area_struct *vma)
idev->vma_count--;
}
-static struct page *uio_vma_nopage(struct vm_area_struct *vma,
- unsigned long address, int *type)
+static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct uio_device *idev = vma->vm_private_data;
- struct page* page = NOPAGE_SIGBUS;
+ struct page *page;
int mi = uio_find_mem_index(vma);
if (mi < 0)
- return page;
+ return VM_FAULT_SIGBUS;
if (idev->info->mem[mi].memtype == UIO_MEM_LOGICAL)
page = virt_to_page(idev->info->mem[mi].addr);
else
page = vmalloc_to_page((void*)idev->info->mem[mi].addr);
get_page(page);
- if (type)
- *type = VM_FAULT_MINOR;
- return page;
+ vmf->page = page;
+ return 0;
}
static struct vm_operations_struct uio_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
- .nopage = uio_vma_nopage,
+ .fault = uio_vma_fault,
};
static int uio_mmap_physical(struct vm_area_struct *vma)