aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 57361708d1a5..6bef278ad303 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1060,7 +1060,7 @@ int copy_page_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
1060 * We do not free on error cases below as remove_vma 1060 * We do not free on error cases below as remove_vma
1061 * gets called on error from higher level routine 1061 * gets called on error from higher level routine
1062 */ 1062 */
1063 ret = track_pfn_vma_copy(vma); 1063 ret = track_pfn_copy(vma);
1064 if (ret) 1064 if (ret)
1065 return ret; 1065 return ret;
1066 } 1066 }
@@ -1328,7 +1328,7 @@ static void unmap_single_vma(struct mmu_gather *tlb,
1328 uprobe_munmap(vma, start, end); 1328 uprobe_munmap(vma, start, end);
1329 1329
1330 if (unlikely(is_pfn_mapping(vma))) 1330 if (unlikely(is_pfn_mapping(vma)))
1331 untrack_pfn_vma(vma, 0, 0); 1331 untrack_pfn(vma, 0, 0);
1332 1332
1333 if (start != end) { 1333 if (start != end) {
1334 if (unlikely(is_vm_hugetlb_page(vma))) { 1334 if (unlikely(is_vm_hugetlb_page(vma))) {
@@ -2162,14 +2162,11 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
2162 2162
2163 if (addr < vma->vm_start || addr >= vma->vm_end) 2163 if (addr < vma->vm_start || addr >= vma->vm_end)
2164 return -EFAULT; 2164 return -EFAULT;
2165 if (track_pfn_vma_new(vma, &pgprot, pfn, PAGE_SIZE)) 2165 if (track_pfn_insert(vma, &pgprot, pfn))
2166 return -EINVAL; 2166 return -EINVAL;
2167 2167
2168 ret = insert_pfn(vma, addr, pfn, pgprot); 2168 ret = insert_pfn(vma, addr, pfn, pgprot);
2169 2169
2170 if (ret)
2171 untrack_pfn_vma(vma, pfn, PAGE_SIZE);
2172
2173 return ret; 2170 return ret;
2174} 2171}
2175EXPORT_SYMBOL(vm_insert_pfn); 2172EXPORT_SYMBOL(vm_insert_pfn);
@@ -2311,7 +2308,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
2311 2308
2312 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; 2309 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
2313 2310
2314 err = track_pfn_vma_new(vma, &prot, pfn, PAGE_ALIGN(size)); 2311 err = track_pfn_remap(vma, &prot, pfn, PAGE_ALIGN(size));
2315 if (err) { 2312 if (err) {
2316 /* 2313 /*
2317 * To indicate that track_pfn related cleanup is not 2314 * To indicate that track_pfn related cleanup is not
@@ -2335,7 +2332,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
2335 } while (pgd++, addr = next, addr != end); 2332 } while (pgd++, addr = next, addr != end);
2336 2333
2337 if (err) 2334 if (err)
2338 untrack_pfn_vma(vma, pfn, PAGE_ALIGN(size)); 2335 untrack_pfn(vma, pfn, PAGE_ALIGN(size));
2339 2336
2340 return err; 2337 return err;
2341} 2338}