Lines Matching defs:clone
242 static void crypt_endio(struct bio *clone);
1658 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1683 struct bio *clone;
1693 clone = bio_alloc_bioset(cc->dev->bdev, nr_iovecs, io->base_bio->bi_opf,
1695 clone->bi_private = io;
1696 clone->bi_end_io = crypt_endio;
1723 crypt_free_buffer_pages(cc, clone);
1724 bio_put(clone);
1732 __bio_add_page(clone, pages, size_to_add, 0);
1737 if (dm_crypt_integrity_io_alloc(io, clone)) {
1738 crypt_free_buffer_pages(cc, clone);
1739 bio_put(clone);
1740 clone = NULL;
1746 return clone;
1749 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone)
1753 if (clone->bi_vcnt > 0) { /* bio_for_each_folio_all crashes with an empty bio */
1754 bio_for_each_folio_all(fi, clone) {
1840 static void crypt_endio(struct bio *clone)
1842 struct dm_crypt_io *io = clone->bi_private;
1844 unsigned int rw = bio_data_dir(clone);
1845 blk_status_t error = clone->bi_status;
1856 crypt_free_buffer_pages(cc, clone);
1858 bio_put(clone);
1876 struct bio *clone;
1882 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size);
1883 if (unlikely(!clone)) {
1887 clone->bi_iter.bi_sector = cc->start + io->sector;
1888 crypt_convert_init(cc, &io->ctx, clone, clone, io->sector);
1889 io->saved_bi_iter = clone->bi_iter;
1890 dm_submit_bio_remap(io->base_bio, clone);
1900 clone = bio_alloc_clone(cc->dev->bdev, io->base_bio, gfp, &cc->bs);
1901 if (!clone)
1903 clone->bi_private = io;
1904 clone->bi_end_io = crypt_endio;
1908 clone->bi_iter.bi_sector = cc->start + io->sector;
1910 if (dm_crypt_integrity_io_alloc(io, clone)) {
1912 bio_put(clone);
1916 dm_submit_bio_remap(io->base_bio, clone);
1940 struct bio *clone = io->ctx.bio_out;
1942 dm_submit_bio_remap(io->base_bio, clone);
2002 struct bio *clone = io->ctx.bio_out;
2009 crypt_free_buffer_pages(cc, clone);
2010 bio_put(clone);
2015 /* crypt_convert should have filled the clone bio */
2018 clone->bi_iter.bi_sector = cc->start + io->sector;
2022 dm_submit_bio_remap(io->base_bio, clone);
2100 struct bio *clone;
2111 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size);
2112 if (unlikely(!clone)) {
2117 io->ctx.bio_out = clone;
2118 io->ctx.iter_out = clone->bi_iter;
2121 bio_copy_data(clone, io->base_bio);
2122 io->ctx.bio_in = clone;
2123 io->ctx.iter_in = clone->bi_iter;
2126 sector += bio_sectors(clone);