lkml.org 
[lkml]   [2018]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 01/10] cramfs: Convert to use vmf_insert_mixed
Date
cramfs is the only remaining user of vm_insert_mixed; convert it.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
---
fs/cramfs/inode.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index f408994fc632..b72449c19cd1 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -417,10 +417,15 @@ 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++) {
+ for (i = 0; i < pages; 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) {
+ pages = i;
+ break;
+ }
}
}

--
2.18.0
\
 
 \ /
  Last update: 2018-08-28 16:59    [W:0.248 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site