Commit 105354a0 authored by Nick Piggin's avatar Nick Piggin Committed by Mauro Carvalho Chehab

V4L/DVB (6748): Subject: v4l: nopage

Convert v4l from nopage to fault.
Remove redundant vma range checks.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 14e3c152
...@@ -385,30 +385,26 @@ videobuf_vm_close(struct vm_area_struct *vma) ...@@ -385,30 +385,26 @@ videobuf_vm_close(struct vm_area_struct *vma)
* now ...). Bounce buffers don't work very well for the data rates * now ...). Bounce buffers don't work very well for the data rates
* video capture has. * video capture has.
*/ */
static struct page* static int
videobuf_vm_nopage(struct vm_area_struct *vma, unsigned long vaddr, videobuf_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
int *type)
{ {
struct page *page; struct page *page;
dprintk(3,"nopage: fault @ %08lx [vma %08lx-%08lx]\n", dprintk(3,"fault: fault @ %08lx [vma %08lx-%08lx]\n",
vaddr,vma->vm_start,vma->vm_end); (unsigned long)vmf->virtual_address,vma->vm_start,vma->vm_end);
if (vaddr > vma->vm_end)
return NOPAGE_SIGBUS;
page = alloc_page(GFP_USER | __GFP_DMA32); page = alloc_page(GFP_USER | __GFP_DMA32);
if (!page) if (!page)
return NOPAGE_OOM; return VM_FAULT_OOM;
clear_user_page(page_address(page), vaddr, page); clear_user_page(page_address(page), vaddr, page);
if (type) vmf->page = page;
*type = VM_FAULT_MINOR; return 0;
return page;
} }
static struct vm_operations_struct videobuf_vm_ops = static struct vm_operations_struct videobuf_vm_ops =
{ {
.open = videobuf_vm_open, .open = videobuf_vm_open,
.close = videobuf_vm_close, .close = videobuf_vm_close,
.nopage = videobuf_vm_nopage, .fault = videobuf_vm_fault,
}; };
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment