Lines Matching refs:clone

291 static void crypt_endio(struct bio *clone);
1683 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1708 struct bio *clone; in crypt_alloc_buffer() local
1718 clone = bio_alloc_bioset(cc->dev->bdev, nr_iovecs, io->base_bio->bi_opf, in crypt_alloc_buffer()
1720 clone->bi_private = io; in crypt_alloc_buffer()
1721 clone->bi_end_io = crypt_endio; in crypt_alloc_buffer()
1722 clone->bi_ioprio = io->base_bio->bi_ioprio; in crypt_alloc_buffer()
1723 clone->bi_iter.bi_sector = cc->start + io->sector; in crypt_alloc_buffer()
1750 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1751 bio_put(clone); in crypt_alloc_buffer()
1759 __bio_add_page(clone, pages, size_to_add, 0); in crypt_alloc_buffer()
1764 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1765 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1766 bio_put(clone); in crypt_alloc_buffer()
1767 clone = NULL; in crypt_alloc_buffer()
1773 return clone; in crypt_alloc_buffer()
1776 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1780 if (clone->bi_vcnt > 0) { /* bio_for_each_folio_all crashes with an empty bio */ in crypt_free_buffer_pages()
1781 bio_for_each_folio_all(fi, clone) { in crypt_free_buffer_pages()
1867 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1869 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1871 unsigned int rw = bio_data_dir(clone); in crypt_endio()
1872 blk_status_t error = clone->bi_status; in crypt_endio()
1883 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1885 bio_put(clone); in crypt_endio()
1903 struct bio *clone; in kcryptd_io_read() local
1909 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_io_read()
1910 if (unlikely(!clone)) { in kcryptd_io_read()
1914 crypt_convert_init(cc, &io->ctx, clone, clone, io->sector); in kcryptd_io_read()
1915 io->saved_bi_iter = clone->bi_iter; in kcryptd_io_read()
1916 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_io_read()
1926 clone = bio_alloc_clone(cc->dev->bdev, io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1927 if (!clone) in kcryptd_io_read()
1930 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1931 clone->bi_private = io; in kcryptd_io_read()
1932 clone->bi_end_io = crypt_endio; in kcryptd_io_read()
1936 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1938 bio_put(clone); in kcryptd_io_read()
1942 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_io_read()
1966 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1968 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_io_write()
2027 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
2034 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
2035 bio_put(clone); in kcryptd_crypt_write_io_submit()
2045 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_crypt_write_io_submit()
2120 struct bio *clone; in kcryptd_crypt_write_convert() local
2130 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
2131 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
2136 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
2137 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
2140 bio_copy_data(clone, io->base_bio); in kcryptd_crypt_write_convert()
2141 io->ctx.bio_in = clone; in kcryptd_crypt_write_convert()
2142 io->ctx.iter_in = clone->bi_iter; in kcryptd_crypt_write_convert()