Skip to content

Commit 7f2764c

Browse files
Nicolas Pitretorvalds
authored andcommitted
cramfs: convert to use vmf_insert_mixed
cramfs is the only remaining user of vm_insert_mixed() and should be converted to vmf_insert_mixed(). Based on a previous patch from Matthew Wilcox. Link: http://lkml.kernel.org/r/nycvar.YSQ.7.76.1808290945450.10215@knanqh.ubzr Signed-off-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Souptick Joarder <jrdr.linux@gmail.com>a Cc: Matthew Wilcox <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4b96a37 commit 7f2764c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎fs/cramfs/inode.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,12 @@ static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
418418
int i;
419419
vma->vm_flags |= VM_MIXEDMAP;
420420
for (i = 0; i < pages && !ret; i++) {
421+
vm_fault_t vmf;
421422
unsigned long off = i * PAGE_SIZE;
422423
pfn_t pfn = phys_to_pfn_t(address + off, PFN_DEV);
423-
ret = vm_insert_mixed(vma, vma->vm_start + off, pfn);
424+
vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn);
425+
if (vmf & VM_FAULT_ERROR)
426+
ret = vm_fault_to_errno(vmf, 0);
424427
}
425428
}
426429

0 commit comments

Comments
 (0)