Lines Matching refs:clone
1636 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1658 struct bio *clone; in crypt_alloc_buffer() local
1668 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs); in crypt_alloc_buffer()
1669 if (!clone) in crypt_alloc_buffer()
1672 clone_init(io, clone); in crypt_alloc_buffer()
1679 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1680 bio_put(clone); in crypt_alloc_buffer()
1687 bio_add_page(clone, page, len, 0); in crypt_alloc_buffer()
1693 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1694 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1695 bio_put(clone); in crypt_alloc_buffer()
1696 clone = NULL; in crypt_alloc_buffer()
1702 return clone; in crypt_alloc_buffer()
1705 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1710 bio_for_each_segment_all(bv, clone, iter_all) { in crypt_free_buffer_pages()
1798 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1800 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1802 unsigned rw = bio_data_dir(clone); in crypt_endio()
1809 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1811 error = clone->bi_status; in crypt_endio()
1812 bio_put(clone); in crypt_endio()
1825 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1829 clone->bi_private = io; in clone_init()
1830 clone->bi_end_io = crypt_endio; in clone_init()
1831 bio_set_dev(clone, cc->dev->bdev); in clone_init()
1832 clone->bi_opf = io->base_bio->bi_opf; in clone_init()
1838 struct bio *clone; in kcryptd_io_read() local
1846 clone = bio_clone_fast(io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1847 if (!clone) in kcryptd_io_read()
1852 clone_init(io, clone); in kcryptd_io_read()
1853 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1855 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1857 bio_put(clone); in kcryptd_io_read()
1861 submit_bio_noacct(clone); in kcryptd_io_read()
1885 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1887 submit_bio_noacct(clone); in kcryptd_io_write()
1946 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1953 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1954 bio_put(clone); in kcryptd_crypt_write_io_submit()
1962 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1966 submit_bio_noacct(clone); in kcryptd_crypt_write_io_submit()
2045 struct bio *clone; in kcryptd_crypt_write_convert() local
2056 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
2057 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
2062 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
2063 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
2065 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()