aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mlock.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-05-12 03:36:18 -0400
committerIngo Molnar <mingo@elte.hu>2011-05-12 03:36:18 -0400
commit9cb5baba5e3acba0994ad899ee908799104c9965 (patch)
treed5ff16000256a0bf56279926e6114b4603ede2b4 /mm/mlock.c
parent7142d17e8f935fa842e9f6eece2281b6d41625d6 (diff)
parent693d92a1bbc9e42681c42ed190bd42b636ca876f (diff)
Merge commit 'v2.6.39-rc7' into sched/core
Diffstat (limited to 'mm/mlock.c')
-rw-r--r--mm/mlock.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/mlock.c b/mm/mlock.c
index 6b55e3efe0df..516b2c2ddd5a 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -162,7 +162,7 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
162 VM_BUG_ON(end > vma->vm_end); 162 VM_BUG_ON(end > vma->vm_end);
163 VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem)); 163 VM_BUG_ON(!rwsem_is_locked(&mm->mmap_sem));
164 164
165 gup_flags = FOLL_TOUCH; 165 gup_flags = FOLL_TOUCH | FOLL_MLOCK;
166 /* 166 /*
167 * We want to touch writable mappings with a write fault in order 167 * We want to touch writable mappings with a write fault in order
168 * to break COW, except for shared mappings because these don't COW 168 * to break COW, except for shared mappings because these don't COW
@@ -178,9 +178,6 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
178 if (vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)) 178 if (vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC))
179 gup_flags |= FOLL_FORCE; 179 gup_flags |= FOLL_FORCE;
180 180
181 if (vma->vm_flags & VM_LOCKED)
182 gup_flags |= FOLL_MLOCK;
183
184 return __get_user_pages(current, mm, addr, nr_pages, gup_flags, 181 return __get_user_pages(current, mm, addr, nr_pages, gup_flags,
185 NULL, NULL, nonblocking); 182 NULL, NULL, nonblocking);
186} 183}