X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Futil.c;h=55bef160b9f1484c032220b506f4ebfaeffe9a47;hb=066ce6899484d9026acd6ba3a8dbbedb33d7ae1b;hp=2599e83eea17a9c9673c26507541b12581e952f0;hpb=22ae77bc7ac115b9d518d5cbc13d39317079b2b0;p=pandora-kernel.git diff --git a/mm/util.c b/mm/util.c index 2599e83eea17..55bef160b9f1 100644 --- a/mm/util.c +++ b/mm/util.c @@ -223,6 +223,22 @@ void arch_pick_mmap_layout(struct mm_struct *mm) } #endif +/** + * get_user_pages_fast() - pin user pages in memory + * @start: starting user address + * @nr_pages: number of pages from start to pin + * @write: whether pages will be written to + * @pages: array that receives pointers to the pages pinned. + * Should be at least nr_pages long. + * + * Attempt to pin user pages in memory without taking mm->mmap_sem. + * If not successful, it will fall back to taking the lock and + * calling get_user_pages(). + * + * Returns number of pages pinned. This may be fewer than the number + * requested. If nr_pages is 0 or negative, returns 0. If no pages + * were pinned, returns -errno. + */ int __attribute__((weak)) get_user_pages_fast(unsigned long start, int nr_pages, int write, struct page **pages) {