Lines Matching refs:clone

272 static void crypt_endio(struct bio *clone);
1682 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1707 struct bio *clone; in crypt_alloc_buffer() local
1717 clone = bio_alloc_bioset(cc->dev->bdev, nr_iovecs, io->base_bio->bi_opf, in crypt_alloc_buffer()
1719 clone->bi_private = io; in crypt_alloc_buffer()
1720 clone->bi_end_io = crypt_endio; in crypt_alloc_buffer()
1721 clone->bi_ioprio = io->base_bio->bi_ioprio; in crypt_alloc_buffer()
1748 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1749 bio_put(clone); in crypt_alloc_buffer()
1757 __bio_add_page(clone, pages, size_to_add, 0); in crypt_alloc_buffer()
1762 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1763 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1764 bio_put(clone); in crypt_alloc_buffer()
1765 clone = NULL; in crypt_alloc_buffer()
1771 return clone; in crypt_alloc_buffer()
1774 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1778 if (clone->bi_vcnt > 0) { /* bio_for_each_folio_all crashes with an empty bio */ in crypt_free_buffer_pages()
1779 bio_for_each_folio_all(fi, clone) { in crypt_free_buffer_pages()
1865 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1867 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1869 unsigned int rw = bio_data_dir(clone); in crypt_endio()
1870 blk_status_t error = clone->bi_status; in crypt_endio()
1881 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1883 bio_put(clone); in crypt_endio()
1901 struct bio *clone; in kcryptd_io_read() local
1907 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_io_read()
1908 if (unlikely(!clone)) { in kcryptd_io_read()
1912 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1913 crypt_convert_init(cc, &io->ctx, clone, clone, io->sector); in kcryptd_io_read()
1914 io->saved_bi_iter = clone->bi_iter; in kcryptd_io_read()
1915 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_io_read()
1925 clone = bio_alloc_clone(cc->dev->bdev, io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1926 if (!clone) in kcryptd_io_read()
1928 clone->bi_private = io; in kcryptd_io_read()
1929 clone->bi_end_io = crypt_endio; in kcryptd_io_read()
1933 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1935 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1937 bio_put(clone); in kcryptd_io_read()
1941 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_io_read()
1965 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1967 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_io_write()
2026 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
2033 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
2034 bio_put(clone); in kcryptd_crypt_write_io_submit()
2042 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
2046 dm_submit_bio_remap(io->base_bio, clone); in kcryptd_crypt_write_io_submit()
2124 struct bio *clone; in kcryptd_crypt_write_convert() local
2135 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
2136 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
2141 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
2142 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
2145 bio_copy_data(clone, io->base_bio); in kcryptd_crypt_write_convert()
2146 io->ctx.bio_in = clone; in kcryptd_crypt_write_convert()
2147 io->ctx.iter_in = clone->bi_iter; in kcryptd_crypt_write_convert()
2150 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()