Lines Matching refs:clone
1377 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1399 struct bio *clone; in crypt_alloc_buffer() local
1409 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs); in crypt_alloc_buffer()
1410 if (!clone) in crypt_alloc_buffer()
1413 clone_init(io, clone); in crypt_alloc_buffer()
1420 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1421 bio_put(clone); in crypt_alloc_buffer()
1428 bio_add_page(clone, page, len, 0); in crypt_alloc_buffer()
1434 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1435 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1436 bio_put(clone); in crypt_alloc_buffer()
1437 clone = NULL; in crypt_alloc_buffer()
1443 return clone; in crypt_alloc_buffer()
1446 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1451 bio_for_each_segment_all(bv, clone, i) { in crypt_free_buffer_pages()
1517 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1519 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1521 unsigned rw = bio_data_dir(clone); in crypt_endio()
1528 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1530 error = clone->bi_status; in crypt_endio()
1531 bio_put(clone); in crypt_endio()
1544 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1548 clone->bi_private = io; in clone_init()
1549 clone->bi_end_io = crypt_endio; in clone_init()
1550 bio_set_dev(clone, cc->dev->bdev); in clone_init()
1551 clone->bi_opf = io->base_bio->bi_opf; in clone_init()
1557 struct bio *clone; in kcryptd_io_read() local
1565 clone = bio_clone_fast(io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1566 if (!clone) in kcryptd_io_read()
1571 clone_init(io, clone); in kcryptd_io_read()
1572 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1574 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1576 bio_put(clone); in kcryptd_io_read()
1580 generic_make_request(clone); in kcryptd_io_read()
1604 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1606 generic_make_request(clone); in kcryptd_io_write()
1665 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1672 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1673 bio_put(clone); in kcryptd_crypt_write_io_submit()
1681 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1684 generic_make_request(clone); in kcryptd_crypt_write_io_submit()
1709 struct bio *clone; in kcryptd_crypt_write_convert() local
1720 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
1721 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
1726 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
1727 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
1729 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()