aboutsummaryrefslogtreecommitdiffstats
path: root/mm/gup.c
diff options
context:
space:
mode:
authorLorenzo Stoakes <lstoakes@gmail.com>2016-12-14 18:06:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 19:04:09 -0500
commit8b7457ef9a9eb46cd1675d40d8e1fd3c47a38395 (patch)
tree485def76ab013b2609eb24762e4c39fc531c72d7 /mm/gup.c
parent5b56d49fc31dbb0487e14ead790fc81ca9fb2c99 (diff)
mm: unexport __get_user_pages_unlocked()
Unexport the low-level __get_user_pages_unlocked() function and replaces invocations with calls to more appropriate higher-level functions. In hva_to_pfn_slow() we are able to replace __get_user_pages_unlocked() with get_user_pages_unlocked() since we can now pass gup_flags. In async_pf_execute() and process_vm_rw_single_vec() we need to pass different tsk, mm arguments so get_user_pages_remote() is the sane replacement in these cases (having added manual acquisition and release of mmap_sem.) Additionally get_user_pages_remote() reintroduces use of the FOLL_TOUCH flag. However, this flag was originally silently dropped by commit 1e9877902dc7 ("mm/gup: Introduce get_user_pages_remote()"), so this appears to have been unintentional and reintroducing it is therefore not an issue. [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/20161027095141.2569-3-lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Jan Kara <jack@suse.cz> Cc: Hugh Dickins <hughd@google.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krcmar <rkrcmar@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/gup.c')
-rw-r--r--mm/gup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/gup.c b/mm/gup.c
index b64c907aa4f0..55315555489d 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -865,9 +865,10 @@ EXPORT_SYMBOL(get_user_pages_locked);
865 * caller if required (just like with __get_user_pages). "FOLL_GET" 865 * caller if required (just like with __get_user_pages). "FOLL_GET"
866 * is set implicitly if "pages" is non-NULL. 866 * is set implicitly if "pages" is non-NULL.
867 */ 867 */
868__always_inline long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm, 868static __always_inline long __get_user_pages_unlocked(struct task_struct *tsk,
869 unsigned long start, unsigned long nr_pages, 869 struct mm_struct *mm, unsigned long start,
870 struct page **pages, unsigned int gup_flags) 870 unsigned long nr_pages, struct page **pages,
871 unsigned int gup_flags)
871{ 872{
872 long ret; 873 long ret;
873 int locked = 1; 874 int locked = 1;
@@ -879,7 +880,6 @@ __always_inline long __get_user_pages_unlocked(struct task_struct *tsk, struct m
879 up_read(&mm->mmap_sem); 880 up_read(&mm->mmap_sem);
880 return ret; 881 return ret;
881} 882}
882EXPORT_SYMBOL(__get_user_pages_unlocked);
883 883
884/* 884/*
885 * get_user_pages_unlocked() is suitable to replace the form: 885 * get_user_pages_unlocked() is suitable to replace the form: