diff options
author | Lorenzo Stoakes <lstoakes@gmail.com> | 2016-10-12 20:20:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-18 17:13:37 -0400 |
commit | c164154f66f0c9b02673f07aa4f044f1d9c70274 (patch) | |
tree | fdfdc521c7cadcbbd8b4bb6bd85e8b17c13fcb13 /mm/nommu.c | |
parent | d4944b0ecec0af882483fe44b66729316e575208 (diff) |
mm: replace get_user_pages_unlocked() write/force parameters with gup_flags
This removes the 'write' and 'force' use from get_user_pages_unlocked()
and replaces them with 'gup_flags' to make the use of FOLL_FORCE
explicit in callers as use of this flag can result in surprising
behaviour (and hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 925dcc1fa2f3..7e27add39f7e 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -197,17 +197,10 @@ long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, | |||
197 | EXPORT_SYMBOL(__get_user_pages_unlocked); | 197 | EXPORT_SYMBOL(__get_user_pages_unlocked); |
198 | 198 | ||
199 | long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, | 199 | long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, |
200 | int write, int force, struct page **pages) | 200 | struct page **pages, unsigned int gup_flags) |
201 | { | 201 | { |
202 | unsigned int flags = 0; | ||
203 | |||
204 | if (write) | ||
205 | flags |= FOLL_WRITE; | ||
206 | if (force) | ||
207 | flags |= FOLL_FORCE; | ||
208 | |||
209 | return __get_user_pages_unlocked(current, current->mm, start, nr_pages, | 202 | return __get_user_pages_unlocked(current, current->mm, start, nr_pages, |
210 | pages, flags); | 203 | pages, gup_flags); |
211 | } | 204 | } |
212 | EXPORT_SYMBOL(get_user_pages_unlocked); | 205 | EXPORT_SYMBOL(get_user_pages_unlocked); |
213 | 206 | ||