Lines Matching refs:clone
1643 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1665 struct bio *clone; in crypt_alloc_buffer() local
1675 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs); in crypt_alloc_buffer()
1676 if (!clone) in crypt_alloc_buffer()
1679 clone_init(io, clone); in crypt_alloc_buffer()
1686 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1687 bio_put(clone); in crypt_alloc_buffer()
1694 bio_add_page(clone, page, len, 0); in crypt_alloc_buffer()
1700 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1701 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1702 bio_put(clone); in crypt_alloc_buffer()
1703 clone = NULL; in crypt_alloc_buffer()
1709 return clone; in crypt_alloc_buffer()
1712 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1717 bio_for_each_segment_all(bv, clone, iter_all) { in crypt_free_buffer_pages()
1805 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1807 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1809 unsigned rw = bio_data_dir(clone); in crypt_endio()
1816 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1818 error = clone->bi_status; in crypt_endio()
1819 bio_put(clone); in crypt_endio()
1832 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1836 clone->bi_private = io; in clone_init()
1837 clone->bi_end_io = crypt_endio; in clone_init()
1838 bio_set_dev(clone, cc->dev->bdev); in clone_init()
1839 clone->bi_opf = io->base_bio->bi_opf; in clone_init()
1845 struct bio *clone; in kcryptd_io_read() local
1853 clone = bio_clone_fast(io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1854 if (!clone) in kcryptd_io_read()
1859 clone_init(io, clone); in kcryptd_io_read()
1860 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1862 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1864 bio_put(clone); in kcryptd_io_read()
1868 submit_bio_noacct(clone); in kcryptd_io_read()
1892 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1894 submit_bio_noacct(clone); in kcryptd_io_write()
1953 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1960 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1961 bio_put(clone); in kcryptd_crypt_write_io_submit()
1969 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1973 submit_bio_noacct(clone); in kcryptd_crypt_write_io_submit()
2052 struct bio *clone; in kcryptd_crypt_write_convert() local
2063 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
2064 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
2069 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
2070 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
2072 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()