diff options
Diffstat (limited to 'arch/x86/mm/gup.c')
-rw-r--r-- | arch/x86/mm/gup.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index be54176e9eb2..6340cef6798a 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -219,6 +219,22 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end, | |||
219 | return 1; | 219 | return 1; |
220 | } | 220 | } |
221 | 221 | ||
222 | /** | ||
223 | * get_user_pages_fast() - pin user pages in memory | ||
224 | * @start: starting user address | ||
225 | * @nr_pages: number of pages from start to pin | ||
226 | * @write: whether pages will be written to | ||
227 | * @pages: array that receives pointers to the pages pinned. | ||
228 | * Should be at least nr_pages long. | ||
229 | * | ||
230 | * Attempt to pin user pages in memory without taking mm->mmap_sem. | ||
231 | * If not successful, it will fall back to taking the lock and | ||
232 | * calling get_user_pages(). | ||
233 | * | ||
234 | * Returns number of pages pinned. This may be fewer than the number | ||
235 | * requested. If nr_pages is 0 or negative, returns 0. If no pages | ||
236 | * were pinned, returns -errno. | ||
237 | */ | ||
222 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 238 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
223 | struct page **pages) | 239 | struct page **pages) |
224 | { | 240 | { |