Lines Matching refs:clone
953 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
974 struct bio *clone; in crypt_alloc_buffer() local
985 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, cc->bs); in crypt_alloc_buffer()
986 if (!clone) in crypt_alloc_buffer()
989 clone_init(io, clone); in crypt_alloc_buffer()
996 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
997 bio_put(clone); in crypt_alloc_buffer()
1004 bvec = &clone->bi_io_vec[clone->bi_vcnt++]; in crypt_alloc_buffer()
1009 clone->bi_iter.bi_size += len; in crypt_alloc_buffer()
1018 return clone; in crypt_alloc_buffer()
1021 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1026 bio_for_each_segment_all(bv, clone, i) { in crypt_free_buffer_pages()
1085 static void crypt_endio(struct bio *clone, int error) in crypt_endio() argument
1087 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1089 unsigned rw = bio_data_dir(clone); in crypt_endio()
1091 if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error)) in crypt_endio()
1098 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1100 bio_put(clone); in crypt_endio()
1113 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1117 clone->bi_private = io; in clone_init()
1118 clone->bi_end_io = crypt_endio; in clone_init()
1119 clone->bi_bdev = cc->dev->bdev; in clone_init()
1120 clone->bi_rw = io->base_bio->bi_rw; in clone_init()
1127 struct bio *clone; in kcryptd_io_read() local
1134 clone = bio_clone_bioset(base_bio, gfp, cc->bs); in kcryptd_io_read()
1135 if (!clone) in kcryptd_io_read()
1140 clone_init(io, clone); in kcryptd_io_read()
1141 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1143 generic_make_request(clone); in kcryptd_io_read()
1167 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1169 generic_make_request(clone); in kcryptd_io_write()
1233 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1240 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1241 bio_put(clone); in kcryptd_crypt_write_io_submit()
1249 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1272 struct bio *clone; in kcryptd_crypt_write_convert() local
1283 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
1284 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
1289 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
1290 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
1292 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()