diff options
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 386443e9d2c6..2d02ca17ce18 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -168,20 +168,20 @@ unsigned int kobjsize(const void *objp) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 170 | int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
171 | unsigned long start, int nr_pages, int flags, | 171 | unsigned long start, int nr_pages, int foll_flags, |
172 | struct page **pages, struct vm_area_struct **vmas) | 172 | struct page **pages, struct vm_area_struct **vmas) |
173 | { | 173 | { |
174 | struct vm_area_struct *vma; | 174 | struct vm_area_struct *vma; |
175 | unsigned long vm_flags; | 175 | unsigned long vm_flags; |
176 | int i; | 176 | int i; |
177 | int write = !!(flags & GUP_FLAGS_WRITE); | ||
178 | int force = !!(flags & GUP_FLAGS_FORCE); | ||
179 | 177 | ||
180 | /* calculate required read or write permissions. | 178 | /* calculate required read or write permissions. |
181 | * - if 'force' is set, we only require the "MAY" flags. | 179 | * If FOLL_FORCE is set, we only require the "MAY" flags. |
182 | */ | 180 | */ |
183 | vm_flags = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD); | 181 | vm_flags = (foll_flags & FOLL_WRITE) ? |
184 | vm_flags &= force ? (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE); | 182 | (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD); |
183 | vm_flags &= (foll_flags & FOLL_FORCE) ? | ||
184 | (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE); | ||
185 | 185 | ||
186 | for (i = 0; i < nr_pages; i++) { | 186 | for (i = 0; i < nr_pages; i++) { |
187 | vma = find_vma(mm, start); | 187 | vma = find_vma(mm, start); |
@@ -223,9 +223,9 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
223 | int flags = 0; | 223 | int flags = 0; |
224 | 224 | ||
225 | if (write) | 225 | if (write) |
226 | flags |= GUP_FLAGS_WRITE; | 226 | flags |= FOLL_WRITE; |
227 | if (force) | 227 | if (force) |
228 | flags |= GUP_FLAGS_FORCE; | 228 | flags |= FOLL_FORCE; |
229 | 229 | ||
230 | return __get_user_pages(tsk, mm, start, nr_pages, flags, pages, vmas); | 230 | return __get_user_pages(tsk, mm, start, nr_pages, flags, pages, vmas); |
231 | } | 231 | } |