diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 67f0ab9077d9..0e4eea10c7b0 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -993,6 +993,30 @@ unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | |||
993 | tlb_finish_mmu(tlb, address, end); | 993 | tlb_finish_mmu(tlb, address, end); |
994 | return end; | 994 | return end; |
995 | } | 995 | } |
996 | EXPORT_SYMBOL_GPL(zap_page_range); | ||
997 | |||
998 | /** | ||
999 | * zap_vma_ptes - remove ptes mapping the vma | ||
1000 | * @vma: vm_area_struct holding ptes to be zapped | ||
1001 | * @address: starting address of pages to zap | ||
1002 | * @size: number of bytes to zap | ||
1003 | * | ||
1004 | * This function only unmaps ptes assigned to VM_PFNMAP vmas. | ||
1005 | * | ||
1006 | * The entire address range must be fully contained within the vma. | ||
1007 | * | ||
1008 | * Returns 0 if successful. | ||
1009 | */ | ||
1010 | int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, | ||
1011 | unsigned long size) | ||
1012 | { | ||
1013 | if (address < vma->vm_start || address + size > vma->vm_end || | ||
1014 | !(vma->vm_flags & VM_PFNMAP)) | ||
1015 | return -1; | ||
1016 | zap_page_range(vma, address, size, NULL); | ||
1017 | return 0; | ||
1018 | } | ||
1019 | EXPORT_SYMBOL_GPL(zap_vma_ptes); | ||
996 | 1020 | ||
997 | /* | 1021 | /* |
998 | * Do a quick page-table lookup for a single page. | 1022 | * Do a quick page-table lookup for a single page. |
@@ -1087,6 +1111,7 @@ no_page_table: | |||
1087 | } | 1111 | } |
1088 | return page; | 1112 | return page; |
1089 | } | 1113 | } |
1114 | EXPORT_SYMBOL_GPL(follow_page); | ||
1090 | 1115 | ||
1091 | /* Can we do the FOLL_ANON optimization? */ | 1116 | /* Can we do the FOLL_ANON optimization? */ |
1092 | static inline int use_zero_page(struct vm_area_struct *vma) | 1117 | static inline int use_zero_page(struct vm_area_struct *vma) |