Lines Matching refs:tio
104 struct dm_target_io tio; member
109 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); in dm_per_bio_data() local
110 if (!tio->inside_dm_io) in dm_per_bio_data()
112 …return (char *)bio - offsetof(struct dm_target_io, clone) - offsetof(struct dm_io, tio) - data_siz… in dm_per_bio_data()
120 …return (struct bio *)((char *)io + offsetof(struct dm_io, tio) + offsetof(struct dm_target_io, clo… in dm_bio_from_per_bio_data()
596 struct dm_target_io *tio; in alloc_io() local
603 tio = container_of(clone, struct dm_target_io, clone); in alloc_io()
604 tio->inside_dm_io = true; in alloc_io()
605 tio->io = NULL; in alloc_io()
607 io = container_of(tio, struct dm_io, tio); in alloc_io()
622 bio_put(&io->tio.clone); in free_io()
628 struct dm_target_io *tio; in alloc_tio() local
630 if (!ci->io->tio.io) { in alloc_tio()
632 tio = &ci->io->tio; in alloc_tio()
638 tio = container_of(clone, struct dm_target_io, clone); in alloc_tio()
639 tio->inside_dm_io = false; in alloc_tio()
642 tio->magic = DM_TIO_MAGIC; in alloc_tio()
643 tio->io = ci->io; in alloc_tio()
644 tio->ti = ti; in alloc_tio()
645 tio->target_bio_nr = target_bio_nr; in alloc_tio()
647 return tio; in alloc_tio()
650 static void free_tio(struct dm_target_io *tio) in free_tio() argument
652 if (tio->inside_dm_io) in free_tio()
654 bio_put(&tio->clone); in free_tio()
1004 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); in clone_endio() local
1005 struct dm_io *io = tio->io; in clone_endio()
1006 struct mapped_device *md = tio->io->md; in clone_endio()
1007 dm_endio_fn endio = tio->ti->type->end_io; in clone_endio()
1022 int r = endio(tio->ti, bio, &error); in clone_endio()
1038 free_tio(tio); in clone_endio()
1233 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); in dm_accept_partial_bio() local
1236 BUG_ON(bi_size > *tio->len_ptr); in dm_accept_partial_bio()
1238 *tio->len_ptr -= bi_size - n_sectors; in dm_accept_partial_bio()
1243 static blk_qc_t __map_bio(struct dm_target_io *tio) in __map_bio() argument
1247 struct bio *clone = &tio->clone; in __map_bio()
1248 struct dm_io *io = tio->io; in __map_bio()
1250 struct dm_target *ti = tio->ti; in __map_bio()
1277 free_tio(tio); in __map_bio()
1281 free_tio(tio); in __map_bio()
1301 static int clone_bio(struct dm_target_io *tio, struct bio *bio, in clone_bio() argument
1304 struct bio *clone = &tio->clone; in clone_bio()
1312 if (unlikely(!dm_target_has_integrity(tio->ti->type) && in clone_bio()
1313 !dm_target_passes_integrity(tio->ti->type))) { in clone_bio()
1315 dm_device_name(tio->io->md), in clone_bio()
1316 tio->ti->type->name); in clone_bio()
1337 struct dm_target_io *tio; in alloc_multiple_bios() local
1344 tio = alloc_tio(ci, ti, 0, GFP_NOIO); in alloc_multiple_bios()
1345 bio_list_add(blist, &tio->clone); in alloc_multiple_bios()
1356 tio = alloc_tio(ci, ti, bio_nr, try ? GFP_NOIO : GFP_NOWAIT); in alloc_multiple_bios()
1357 if (!tio) in alloc_multiple_bios()
1360 bio_list_add(blist, &tio->clone); in alloc_multiple_bios()
1368 tio = container_of(bio, struct dm_target_io, clone); in alloc_multiple_bios()
1369 free_tio(tio); in alloc_multiple_bios()
1375 struct dm_target_io *tio, unsigned *len) in __clone_and_map_simple_bio() argument
1377 struct bio *clone = &tio->clone; in __clone_and_map_simple_bio()
1379 tio->len_ptr = len; in __clone_and_map_simple_bio()
1385 return __map_bio(tio); in __clone_and_map_simple_bio()
1393 struct dm_target_io *tio; in __send_duplicate_bios() local
1398 tio = container_of(bio, struct dm_target_io, clone); in __send_duplicate_bios()
1399 (void) __clone_and_map_simple_bio(ci, tio, len); in __send_duplicate_bios()
1430 struct dm_target_io *tio; in __clone_and_map_data_bio() local
1433 tio = alloc_tio(ci, ti, 0, GFP_NOIO); in __clone_and_map_data_bio()
1434 tio->len_ptr = len; in __clone_and_map_data_bio()
1435 r = clone_bio(tio, bio, sector, *len); in __clone_and_map_data_bio()
1437 free_tio(tio); in __clone_and_map_data_bio()
1440 (void) __map_bio(tio); in __clone_and_map_data_bio()
1686 struct dm_target_io *tio; in __process_bio() local
1693 tio = alloc_tio(&ci, ti, 0, GFP_NOIO); in __process_bio()
1694 ret = __clone_and_map_simple_bio(&ci, tio, NULL); in __process_bio()
3074 io_front_pad = roundup(front_pad, __alignof__(struct dm_io)) + offsetof(struct dm_io, tio); in dm_alloc_md_mempools()