Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83453
b: refs/heads/master
c: a18b630
h: refs/heads/master
i:
  83451: 481d08a
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Feb 6, 2008
1 parent 8fe98a8 commit 4912f45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1e096129bff79ae551592539bef19bfb5c9efa1
refs/heads/master: a18b630d1becdf1a087de644fea080c1977bcf10
14 changes: 6 additions & 8 deletions trunk/drivers/uio/uio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4912f45

Please sign in to comment.