Lines Matching refs:nr_pages
16 static void *io_mem_alloc_compound(struct page **pages, int nr_pages,
32 for (i = 0; i < nr_pages; i++)
38 static void *io_mem_alloc_single(struct page **pages, int nr_pages, size_t size,
44 for (i = 0; i < nr_pages; i++) {
50 ret = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL);
64 int nr_pages;
67 nr_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
68 pages = kvmalloc_array(nr_pages, sizeof(struct page *), gfp);
72 ret = io_mem_alloc_compound(pages, nr_pages, size, gfp);
76 ret = io_mem_alloc_single(pages, nr_pages, size, gfp);
80 *npages = nr_pages;
134 unsigned long start, end, nr_pages;
140 nr_pages = end - start;
141 if (WARN_ON_ONCE(!nr_pages))
144 pages = kvmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL);
148 ret = pin_user_pages_fast(uaddr, nr_pages, FOLL_WRITE | FOLL_LONGTERM,
151 if (ret == nr_pages) {
152 *npages = nr_pages;
171 unsigned int nr_pages;
179 nr_pages = 0;
180 page_array = io_pin_pages(uaddr, size, &nr_pages);
184 page_addr = vmap(page_array, nr_pages, VM_MAP, PAGE_KERNEL);
187 *npages = nr_pages;
191 io_pages_free(&page_array, nr_pages);
234 unsigned long nr_pages = npages;
237 return vm_insert_pages(vma, vma->vm_start, pages, &nr_pages);