Commit a18b630d authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

uio: nopage

Convert uio from nopage to fault.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Acked-by: default avatarHans J Koch <hjk@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a1e09612
......@@ -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)
......
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