Lines Matching full:dp

162 	void (*get_page)(struct dpages *dp,
164 void (*next_page)(struct dpages *dp);
179 static void list_get_page(struct dpages *dp, in list_get_page() argument
182 unsigned o = dp->context_u; in list_get_page()
183 struct page_list *pl = (struct page_list *) dp->context_ptr; in list_get_page()
190 static void list_next_page(struct dpages *dp) in list_next_page() argument
192 struct page_list *pl = (struct page_list *) dp->context_ptr; in list_next_page()
193 dp->context_ptr = pl->next; in list_next_page()
194 dp->context_u = 0; in list_next_page()
197 static void list_dp_init(struct dpages *dp, struct page_list *pl, unsigned offset) in list_dp_init() argument
199 dp->get_page = list_get_page; in list_dp_init()
200 dp->next_page = list_next_page; in list_dp_init()
201 dp->context_u = offset; in list_dp_init()
202 dp->context_ptr = pl; in list_dp_init()
208 static void bio_get_page(struct dpages *dp, struct page **p, in bio_get_page() argument
211 struct bio_vec bvec = bvec_iter_bvec((struct bio_vec *)dp->context_ptr, in bio_get_page()
212 dp->context_bi); in bio_get_page()
219 dp->context_bi.bi_sector = (sector_t)bvec.bv_len; in bio_get_page()
222 static void bio_next_page(struct dpages *dp) in bio_next_page() argument
224 unsigned int len = (unsigned int)dp->context_bi.bi_sector; in bio_next_page()
226 bvec_iter_advance((struct bio_vec *)dp->context_ptr, in bio_next_page()
227 &dp->context_bi, len); in bio_next_page()
230 static void bio_dp_init(struct dpages *dp, struct bio *bio) in bio_dp_init() argument
232 dp->get_page = bio_get_page; in bio_dp_init()
233 dp->next_page = bio_next_page; in bio_dp_init()
239 dp->context_ptr = bio->bi_io_vec; in bio_dp_init()
240 dp->context_bi = bio->bi_iter; in bio_dp_init()
246 static void vm_get_page(struct dpages *dp, in vm_get_page() argument
249 *p = vmalloc_to_page(dp->context_ptr); in vm_get_page()
250 *offset = dp->context_u; in vm_get_page()
251 *len = PAGE_SIZE - dp->context_u; in vm_get_page()
254 static void vm_next_page(struct dpages *dp) in vm_next_page() argument
256 dp->context_ptr += PAGE_SIZE - dp->context_u; in vm_next_page()
257 dp->context_u = 0; in vm_next_page()
260 static void vm_dp_init(struct dpages *dp, void *data) in vm_dp_init() argument
262 dp->get_page = vm_get_page; in vm_dp_init()
263 dp->next_page = vm_next_page; in vm_dp_init()
264 dp->context_u = offset_in_page(data); in vm_dp_init()
265 dp->context_ptr = data; in vm_dp_init()
271 static void km_get_page(struct dpages *dp, struct page **p, unsigned long *len, in km_get_page() argument
274 *p = virt_to_page(dp->context_ptr); in km_get_page()
275 *offset = dp->context_u; in km_get_page()
276 *len = PAGE_SIZE - dp->context_u; in km_get_page()
279 static void km_next_page(struct dpages *dp) in km_next_page() argument
281 dp->context_ptr += PAGE_SIZE - dp->context_u; in km_next_page()
282 dp->context_u = 0; in km_next_page()
285 static void km_dp_init(struct dpages *dp, void *data) in km_dp_init() argument
287 dp->get_page = km_get_page; in km_dp_init()
288 dp->next_page = km_next_page; in km_dp_init()
289 dp->context_u = offset_in_page(data); in km_dp_init()
290 dp->context_ptr = data; in km_dp_init()
297 struct dm_io_region *where, struct dpages *dp, in do_region() argument
357 dp->get_page(dp, &page, &len, &offset); in do_region()
364 dp->next_page(dp); in do_region()
373 struct dm_io_region *where, struct dpages *dp, in dispatch_io() argument
377 struct dpages old_pages = *dp; in dispatch_io()
386 * the dp object for each call to do_region. in dispatch_io()
389 *dp = old_pages; in dispatch_io()
391 do_region(opf, i, where + i, dp, io); in dispatch_io()
415 struct dm_io_region *where, blk_opf_t opf, struct dpages *dp, in sync_io() argument
435 io->vma_invalidate_address = dp->vma_invalidate_address; in sync_io()
436 io->vma_invalidate_size = dp->vma_invalidate_size; in sync_io()
438 dispatch_io(opf, num_regions, where, dp, io, 1); in sync_io()
450 struct dpages *dp, io_notify_fn fn, void *context) in async_io() argument
467 io->vma_invalidate_address = dp->vma_invalidate_address; in async_io()
468 io->vma_invalidate_size = dp->vma_invalidate_size; in async_io()
470 dispatch_io(opf, num_regions, where, dp, io, 0); in async_io()
474 static int dp_init(struct dm_io_request *io_req, struct dpages *dp, in dp_init() argument
479 dp->vma_invalidate_address = NULL; in dp_init()
480 dp->vma_invalidate_size = 0; in dp_init()
484 list_dp_init(dp, io_req->mem.ptr.pl, io_req->mem.offset); in dp_init()
488 bio_dp_init(dp, io_req->mem.ptr.bio); in dp_init()
494 dp->vma_invalidate_address = io_req->mem.ptr.vma; in dp_init()
495 dp->vma_invalidate_size = size; in dp_init()
497 vm_dp_init(dp, io_req->mem.ptr.vma); in dp_init()
501 km_dp_init(dp, io_req->mem.ptr.addr); in dp_init()
515 struct dpages dp; in dm_io() local
517 r = dp_init(io_req, &dp, (unsigned long)where->count << SECTOR_SHIFT); in dm_io()
523 io_req->bi_opf, &dp, sync_error_bits); in dm_io()
526 io_req->bi_opf, &dp, io_req->notify.fn, in dm_io()