cramfs: convert to use vmf_insert_mixed
authorNicolas Pitre <[email protected]>
Fri, 26 Oct 2018 22:04:06 +0000 (15:04 -0700)
committerLinus Torvalds <[email protected]>
Fri, 26 Oct 2018 23:25:19 +0000 (16:25 -0700)
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/[email protected]
Signed-off-by: Nicolas Pitre <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: Souptick Joarder <[email protected]>a
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/cramfs/inode.c

index f408994fc632129dcbdceca43cedf2fd14705205..0c35e62f108d16bcf7920173e58156f0a71e9c98 100644 (file)
@@ -418,9 +418,12 @@ static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
                int i;
                vma->vm_flags |= VM_MIXEDMAP;
                for (i = 0; i < pages && !ret; i++) {
+                       vm_fault_t vmf;
                        unsigned long off = i * PAGE_SIZE;
                        pfn_t pfn = phys_to_pfn_t(address + off, PFN_DEV);
-                       ret = vm_insert_mixed(vma, vma->vm_start + off, pfn);
+                       vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn);
+                       if (vmf & VM_FAULT_ERROR)
+                               ret = vm_fault_to_errno(vmf, 0);
                }
        }