diff options
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -225,6 +225,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) | |||
225 | } | 225 | } |
226 | #endif | 226 | #endif |
227 | 227 | ||
228 | /** | ||
229 | * get_user_pages_fast() - pin user pages in memory | ||
230 | * @start: starting user address | ||
231 | * @nr_pages: number of pages from start to pin | ||
232 | * @write: whether pages will be written to | ||
233 | * @pages: array that receives pointers to the pages pinned. | ||
234 | * Should be at least nr_pages long. | ||
235 | * | ||
236 | * Attempt to pin user pages in memory without taking mm->mmap_sem. | ||
237 | * If not successful, it will fall back to taking the lock and | ||
238 | * calling get_user_pages(). | ||
239 | * | ||
240 | * Returns number of pages pinned. This may be fewer than the number | ||
241 | * requested. If nr_pages is 0 or negative, returns 0. If no pages | ||
242 | * were pinned, returns -errno. | ||
243 | */ | ||
228 | int __attribute__((weak)) get_user_pages_fast(unsigned long start, | 244 | int __attribute__((weak)) get_user_pages_fast(unsigned long start, |
229 | int nr_pages, int write, struct page **pages) | 245 | int nr_pages, int write, struct page **pages) |
230 | { | 246 | { |