File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,13 @@ static vm_fault_t udmabuf_vm_fault(struct vm_fault *vmf)
35
35
struct vm_area_struct * vma = vmf -> vma ;
36
36
struct udmabuf * ubuf = vma -> vm_private_data ;
37
37
pgoff_t pgoff = vmf -> pgoff ;
38
+ unsigned long pfn ;
38
39
39
40
if (pgoff >= ubuf -> pagecount )
40
41
return VM_FAULT_SIGBUS ;
41
- vmf -> page = ubuf -> pages [ pgoff ];
42
- get_page ( vmf -> page );
43
- return 0 ;
42
+
43
+ pfn = page_to_pfn ( ubuf -> pages [ pgoff ] );
44
+ return vmf_insert_pfn ( vma , vmf -> address , pfn ) ;
44
45
}
45
46
46
47
static const struct vm_operations_struct udmabuf_vm_ops = {
@@ -56,6 +57,7 @@ static int mmap_udmabuf(struct dma_buf *buf, struct vm_area_struct *vma)
56
57
57
58
vma -> vm_ops = & udmabuf_vm_ops ;
58
59
vma -> vm_private_data = ubuf ;
60
+ vm_flags_set (vma , VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP );
59
61
return 0 ;
60
62
}
61
63
You can’t perform that action at this time.
0 commit comments