Skip to content

Commit a18b630

Browse files
Nick PigginLinus Torvalds
authored andcommitted
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>
1 parent a1e0961 commit a18b630

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎drivers/uio/uio.c‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,30 +417,28 @@ static void uio_vma_close(struct vm_area_struct *vma)
417417
idev->vma_count--;
418418
}
419419

420-
static struct page *uio_vma_nopage(struct vm_area_struct *vma,
421-
unsigned long address, int *type)
420+
static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
422421
{
423422
struct uio_device *idev = vma->vm_private_data;
424-
struct page* page = NOPAGE_SIGBUS;
423+
struct page *page;
425424

426425
int mi = uio_find_mem_index(vma);
427426
if (mi < 0)
428-
return page;
427+
return VM_FAULT_SIGBUS;
429428

430429
if (idev->info->mem[mi].memtype == UIO_MEM_LOGICAL)
431430
page = virt_to_page(idev->info->mem[mi].addr);
432431
else
433432
page = vmalloc_to_page((void*)idev->info->mem[mi].addr);
434433
get_page(page);
435-
if (type)
436-
*type = VM_FAULT_MINOR;
437-
return page;
434+
vmf->page = page;
435+
return 0;
438436
}
439437

440438
static struct vm_operations_struct uio_vm_ops = {
441439
.open = uio_vma_open,
442440
.close = uio_vma_close,
443-
.nopage = uio_vma_nopage,
441+
.fault = uio_vma_fault,
444442
};
445443

446444
static int uio_mmap_physical(struct vm_area_struct *vma)

0 commit comments

Comments
 (0)