aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/memory.c b/mm/memory.c
index e6a9700359df..98bcb90d5957 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1310,8 +1310,9 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1310 cond_resched(); 1310 cond_resched();
1311 while (!(page = follow_page(vma, start, foll_flags))) { 1311 while (!(page = follow_page(vma, start, foll_flags))) {
1312 int ret; 1312 int ret;
1313 ret = handle_mm_fault(mm, vma, start, 1313
1314 foll_flags & FOLL_WRITE); 1314 /* FOLL_WRITE matches FAULT_FLAG_WRITE! */
1315 ret = handle_mm_fault(mm, vma, start, foll_flags & FOLL_WRITE);
1315 if (ret & VM_FAULT_ERROR) { 1316 if (ret & VM_FAULT_ERROR) {
1316 if (ret & VM_FAULT_OOM) 1317 if (ret & VM_FAULT_OOM)
1317 return i ? i : -ENOMEM; 1318 return i ? i : -ENOMEM;
@@ -2958,13 +2959,12 @@ unlock:
2958 * By the time we get here, we already hold the mm semaphore 2959 * By the time we get here, we already hold the mm semaphore
2959 */ 2960 */
2960int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, 2961int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2961 unsigned long address, int write_access) 2962 unsigned long address, unsigned int flags)
2962{ 2963{
2963 pgd_t *pgd; 2964 pgd_t *pgd;
2964 pud_t *pud; 2965 pud_t *pud;
2965 pmd_t *pmd; 2966 pmd_t *pmd;
2966 pte_t *pte; 2967 pte_t *pte;
2967 unsigned int flags = write_access ? FAULT_FLAG_WRITE : 0;
2968 2968
2969 __set_current_state(TASK_RUNNING); 2969 __set_current_state(TASK_RUNNING);
2970 2970