Lines Matching refs:clone
1596 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1618 struct bio *clone; in crypt_alloc_buffer() local
1628 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs); in crypt_alloc_buffer()
1629 if (!clone) in crypt_alloc_buffer()
1632 clone_init(io, clone); in crypt_alloc_buffer()
1639 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1640 bio_put(clone); in crypt_alloc_buffer()
1647 bio_add_page(clone, page, len, 0); in crypt_alloc_buffer()
1653 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1654 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1655 bio_put(clone); in crypt_alloc_buffer()
1656 clone = NULL; in crypt_alloc_buffer()
1662 return clone; in crypt_alloc_buffer()
1665 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1670 bio_for_each_segment_all(bv, clone, iter_all) { in crypt_free_buffer_pages()
1736 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1738 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1740 unsigned rw = bio_data_dir(clone); in crypt_endio()
1747 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1749 error = clone->bi_status; in crypt_endio()
1750 bio_put(clone); in crypt_endio()
1763 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1767 clone->bi_private = io; in clone_init()
1768 clone->bi_end_io = crypt_endio; in clone_init()
1769 bio_set_dev(clone, cc->dev->bdev); in clone_init()
1770 clone->bi_opf = io->base_bio->bi_opf; in clone_init()
1776 struct bio *clone; in kcryptd_io_read() local
1784 clone = bio_clone_fast(io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1785 if (!clone) in kcryptd_io_read()
1790 clone_init(io, clone); in kcryptd_io_read()
1791 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1793 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1795 bio_put(clone); in kcryptd_io_read()
1799 submit_bio_noacct(clone); in kcryptd_io_read()
1823 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1825 submit_bio_noacct(clone); in kcryptd_io_write()
1884 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1891 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1892 bio_put(clone); in kcryptd_crypt_write_io_submit()
1900 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1904 submit_bio_noacct(clone); in kcryptd_crypt_write_io_submit()
1952 struct bio *clone; in kcryptd_crypt_write_convert() local
1963 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
1964 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
1969 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
1970 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
1972 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()