Lines Matching refs:clone

1635 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1657 struct bio *clone; in crypt_alloc_buffer() local
1667 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs); in crypt_alloc_buffer()
1668 if (!clone) in crypt_alloc_buffer()
1671 clone_init(io, clone); in crypt_alloc_buffer()
1678 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1679 bio_put(clone); in crypt_alloc_buffer()
1686 bio_add_page(clone, page, len, 0); in crypt_alloc_buffer()
1692 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1693 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1694 bio_put(clone); in crypt_alloc_buffer()
1695 clone = NULL; in crypt_alloc_buffer()
1701 return clone; in crypt_alloc_buffer()
1704 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1709 bio_for_each_segment_all(bv, clone, iter_all) { in crypt_free_buffer_pages()
1797 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1799 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1801 unsigned rw = bio_data_dir(clone); in crypt_endio()
1808 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1810 error = clone->bi_status; in crypt_endio()
1811 bio_put(clone); in crypt_endio()
1824 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1828 clone->bi_private = io; in clone_init()
1829 clone->bi_end_io = crypt_endio; in clone_init()
1830 bio_set_dev(clone, cc->dev->bdev); in clone_init()
1831 clone->bi_opf = io->base_bio->bi_opf; in clone_init()
1837 struct bio *clone; in kcryptd_io_read() local
1845 clone = bio_clone_fast(io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1846 if (!clone) in kcryptd_io_read()
1851 clone_init(io, clone); in kcryptd_io_read()
1852 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1854 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1856 bio_put(clone); in kcryptd_io_read()
1860 submit_bio_noacct(clone); in kcryptd_io_read()
1884 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1886 submit_bio_noacct(clone); in kcryptd_io_write()
1945 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1952 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1953 bio_put(clone); in kcryptd_crypt_write_io_submit()
1961 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1965 submit_bio_noacct(clone); in kcryptd_crypt_write_io_submit()
2044 struct bio *clone; in kcryptd_crypt_write_convert() local
2055 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
2056 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
2061 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
2062 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
2064 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()