aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-10 12:01:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-21 16:08:22 -0400
commitd06063cc221fdefcab86589e79ddfdb7c0e14b63 (patch)
tree00ccaf8c1992b57a4445d78b9eae25fde0b3ab31 /mm
parent30c9f3a9fae79517bca595826a19c6855fbb6d32 (diff)
Move FAULT_FLAG_xyz into handle_mm_fault() callers
This allows the callers to now pass down the full set of FAULT_FLAG_xyz flags to handle_mm_fault(). All callers have been (mechanically) converted to the new calling convention, there's almost certainly room for architectures to clean up their code and then add FAULT_FLAG_RETRY when that support is added. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-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