Lines Matching refs:clone

954 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone);
976 struct bio *clone; in crypt_alloc_buffer() local
987 clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, cc->bs); in crypt_alloc_buffer()
988 if (!clone) in crypt_alloc_buffer()
991 clone_init(io, clone); in crypt_alloc_buffer()
998 crypt_free_buffer_pages(cc, clone); in crypt_alloc_buffer()
999 bio_put(clone); in crypt_alloc_buffer()
1006 bvec = &clone->bi_io_vec[clone->bi_vcnt++]; in crypt_alloc_buffer()
1011 clone->bi_iter.bi_size += len; in crypt_alloc_buffer()
1020 return clone; in crypt_alloc_buffer()
1023 static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone) in crypt_free_buffer_pages() argument
1028 bio_for_each_segment_all(bv, clone, i) { in crypt_free_buffer_pages()
1087 static void crypt_endio(struct bio *clone, int error) in crypt_endio() argument
1089 struct dm_crypt_io *io = clone->bi_private; in crypt_endio()
1091 unsigned rw = bio_data_dir(clone); in crypt_endio()
1093 if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error)) in crypt_endio()
1100 crypt_free_buffer_pages(cc, clone); in crypt_endio()
1102 bio_put(clone); in crypt_endio()
1115 static void clone_init(struct dm_crypt_io *io, struct bio *clone) in clone_init() argument
1119 clone->bi_private = io; in clone_init()
1120 clone->bi_end_io = crypt_endio; in clone_init()
1121 clone->bi_bdev = cc->dev->bdev; in clone_init()
1122 clone->bi_rw = io->base_bio->bi_rw; in clone_init()
1128 struct bio *clone; in kcryptd_io_read() local
1136 clone = bio_clone_fast(io->base_bio, gfp, cc->bs); in kcryptd_io_read()
1137 if (!clone) in kcryptd_io_read()
1142 clone_init(io, clone); in kcryptd_io_read()
1143 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_io_read()
1145 generic_make_request(clone); in kcryptd_io_read()
1169 struct bio *clone = io->ctx.bio_out; in kcryptd_io_write() local
1171 generic_make_request(clone); in kcryptd_io_write()
1235 struct bio *clone = io->ctx.bio_out; in kcryptd_crypt_write_io_submit() local
1242 crypt_free_buffer_pages(cc, clone); in kcryptd_crypt_write_io_submit()
1243 bio_put(clone); in kcryptd_crypt_write_io_submit()
1251 clone->bi_iter.bi_sector = cc->start + io->sector; in kcryptd_crypt_write_io_submit()
1254 generic_make_request(clone); in kcryptd_crypt_write_io_submit()
1279 struct bio *clone; in kcryptd_crypt_write_convert() local
1290 clone = crypt_alloc_buffer(io, io->base_bio->bi_iter.bi_size); in kcryptd_crypt_write_convert()
1291 if (unlikely(!clone)) { in kcryptd_crypt_write_convert()
1296 io->ctx.bio_out = clone; in kcryptd_crypt_write_convert()
1297 io->ctx.iter_out = clone->bi_iter; in kcryptd_crypt_write_convert()
1299 sector += bio_sectors(clone); in kcryptd_crypt_write_convert()