diff options
Diffstat (limited to 'mm/gup.c')
-rw-r--r-- | mm/gup.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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, | 868 | static __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 | } |
882 | EXPORT_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: |
@@ -917,6 +917,9 @@ EXPORT_SYMBOL(get_user_pages_unlocked); | |||
917 | * only intends to ensure the pages are faulted in. | 917 | * only intends to ensure the pages are faulted in. |
918 | * @vmas: array of pointers to vmas corresponding to each page. | 918 | * @vmas: array of pointers to vmas corresponding to each page. |
919 | * Or NULL if the caller does not require them. | 919 | * Or NULL if the caller does not require them. |
920 | * @locked: pointer to lock flag indicating whether lock is held and | ||
921 | * subsequently whether VM_FAULT_RETRY functionality can be | ||
922 | * utilised. Lock must initially be held. | ||
920 | * | 923 | * |
921 | * Returns number of pages pinned. This may be fewer than the number | 924 | * Returns number of pages pinned. This may be fewer than the number |
922 | * requested. If nr_pages is 0 or negative, returns 0. If no pages | 925 | * requested. If nr_pages is 0 or negative, returns 0. If no pages |
@@ -960,10 +963,10 @@ EXPORT_SYMBOL(get_user_pages_unlocked); | |||
960 | long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, | 963 | long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, |
961 | unsigned long start, unsigned long nr_pages, | 964 | unsigned long start, unsigned long nr_pages, |
962 | unsigned int gup_flags, struct page **pages, | 965 | unsigned int gup_flags, struct page **pages, |
963 | struct vm_area_struct **vmas) | 966 | struct vm_area_struct **vmas, int *locked) |
964 | { | 967 | { |
965 | return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas, | 968 | return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas, |
966 | NULL, false, | 969 | locked, true, |
967 | gup_flags | FOLL_TOUCH | FOLL_REMOTE); | 970 | gup_flags | FOLL_TOUCH | FOLL_REMOTE); |
968 | } | 971 | } |
969 | EXPORT_SYMBOL(get_user_pages_remote); | 972 | EXPORT_SYMBOL(get_user_pages_remote); |
@@ -971,8 +974,9 @@ EXPORT_SYMBOL(get_user_pages_remote); | |||
971 | /* | 974 | /* |
972 | * This is the same as get_user_pages_remote(), just with a | 975 | * This is the same as get_user_pages_remote(), just with a |
973 | * less-flexible calling convention where we assume that the task | 976 | * less-flexible calling convention where we assume that the task |
974 | * and mm being operated on are the current task's. We also | 977 | * and mm being operated on are the current task's and don't allow |
975 | * obviously don't pass FOLL_REMOTE in here. | 978 | * passing of a locked parameter. We also obviously don't pass |
979 | * FOLL_REMOTE in here. | ||
976 | */ | 980 | */ |
977 | long get_user_pages(unsigned long start, unsigned long nr_pages, | 981 | long get_user_pages(unsigned long start, unsigned long nr_pages, |
978 | unsigned int gup_flags, struct page **pages, | 982 | unsigned int gup_flags, struct page **pages, |