Lines Matching full:pages
16 static void *io_mem_alloc_compound(struct page **pages, int nr_pages, in io_mem_alloc_compound() argument
33 pages[i] = page + i; in io_mem_alloc_compound()
38 static void *io_mem_alloc_single(struct page **pages, int nr_pages, size_t size, in io_mem_alloc_single() argument
45 pages[i] = alloc_page(gfp); in io_mem_alloc_single()
46 if (!pages[i]) in io_mem_alloc_single()
50 ret = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); in io_mem_alloc_single()
55 put_page(pages[i]); in io_mem_alloc_single()
63 struct page **pages; in io_pages_map() local
68 pages = kvmalloc_array(nr_pages, sizeof(struct page *), gfp); in io_pages_map()
69 if (!pages) in io_pages_map()
72 ret = io_mem_alloc_compound(pages, nr_pages, size, gfp); in io_pages_map()
76 ret = io_mem_alloc_single(pages, nr_pages, size, gfp); in io_pages_map()
79 *out_pages = pages; in io_pages_map()
84 kvfree(pages); in io_pages_map()
90 void io_pages_unmap(void *ptr, struct page ***pages, unsigned short *npages, in io_pages_unmap() argument
99 struct page **to_free = *pages; in io_pages_unmap()
115 kvfree(*pages); in io_pages_unmap()
116 *pages = NULL; in io_pages_unmap()
120 void io_pages_free(struct page ***pages, int npages) in io_pages_free() argument
122 struct page **page_array = *pages; in io_pages_free()
129 *pages = NULL; in io_pages_free()
135 struct page **pages; in io_pin_pages() local
144 pages = kvmalloc_array(nr_pages, sizeof(struct page *), GFP_KERNEL); in io_pin_pages()
145 if (!pages) in io_pin_pages()
149 pages); in io_pin_pages()
150 /* success, mapped all pages */ in io_pin_pages()
153 return pages; in io_pin_pages()
158 /* if we did partial map, release any pages we did get */ in io_pin_pages()
160 unpin_user_pages(pages, ret); in io_pin_pages()
163 kvfree(pages); in io_pin_pages()
167 void *__io_uaddr_map(struct page ***pages, unsigned short *npages, in __io_uaddr_map() argument
186 *pages = page_array; in __io_uaddr_map()
232 struct page **pages, int npages) in io_uring_mmap_pages() argument
237 return vm_insert_pages(vma, vma->vm_start, pages, &nr_pages); in io_uring_mmap_pages()