Lines Matching refs:clone

1271 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
1293 struct bio *clone; in crypt_alloc_buffer() local
1303 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs); in crypt_alloc_buffer()
1304 if (!clone) in crypt_alloc_buffer()
1307 clone_init(io, clone); in crypt_alloc_buffer()
1314 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1315 bio_put(clone); in crypt_alloc_buffer()
1322 bio_add_page(clone, page, len, 0); in crypt_alloc_buffer()
1328 if (dm_crypt_integrity_io_alloc(io, clone)) { in crypt_alloc_buffer()
1329 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
1330 bio_put(clone); in crypt_alloc_buffer()
1331 clone = NULL; in crypt_alloc_buffer()
1337 return clone; in crypt_alloc_buffer()
1340 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1345 bio_for_each_segment_all(bv, clone, iter_all) { in crypt_free_buffer_pages()
1411 static void crypt_endio(struct bio *clone) in crypt_endio() argument
1413 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1415 unsigned rw = bio_data_dir(clone); in crypt_endio()
1422 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1424 error = clone->bi_status; in crypt_endio()
1425 bio_put(clone); in crypt_endio()
1438 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1442 clone->bi_private = io; in clone_init()
1443 clone->bi_end_io = crypt_endio; in clone_init()
1444 bio_set_dev(clone, cc->dev->bdev); in clone_init()
1445 clone->bi_opf = io->base_bio->bi_opf; in clone_init()
1451 struct bio *clone; in kcryptd_io_read() local
1459 clone = bio_clone_fast(io->base_bio, gfp, &cc->bs); in kcryptd_io_read()
1460 if (!clone) in kcryptd_io_read()
1465 clone_init(io, clone); in kcryptd_io_read()
1466 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1468 if (dm_crypt_integrity_io_alloc(io, clone)) { in kcryptd_io_read()
1470 bio_put(clone); in kcryptd_io_read()
1474 generic_make_request(clone); in kcryptd_io_read()
1498 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1500 generic_make_request(clone); in kcryptd_io_write()
1559 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1566 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1567 bio_put(clone); in kcryptd_crypt_write_io_submit()
1575 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1578 generic_make_request(clone); in kcryptd_crypt_write_io_submit()
1603 struct bio *clone; in kcryptd_crypt_write_convert() local
1614 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
1615 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
1620 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
1621 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
1623 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()