dm-crypt.c (395c72a707d966b36d5a42fe12c3a237ded3a0d9) dm-crypt.c (bf800ef1816b4283a885e55ad38068aec9711e4d)
1/*
2 * Copyright (C) 2003 Christophe Saout <christophe@saout.de>
3 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>
4 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.
5 *
6 * This file is released under the GPL.
7 */
8

--- 965 unchanged lines hidden (view full) ---

974 struct bio *base_bio = io->base_bio;
975 struct bio *clone;
976
977 /*
978 * The block layer might modify the bvec array, so always
979 * copy the required bvecs because we need the original
980 * one in order to decrypt the whole bio data *afterwards*.
981 */
1/*
2 * Copyright (C) 2003 Christophe Saout <christophe@saout.de>
3 * Copyright (C) 2004 Clemens Fruhwirth <clemens@endorphin.org>
4 * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.
5 *
6 * This file is released under the GPL.
7 */
8

--- 965 unchanged lines hidden (view full) ---

974 struct bio *base_bio = io->base_bio;
975 struct bio *clone;
976
977 /*
978 * The block layer might modify the bvec array, so always
979 * copy the required bvecs because we need the original
980 * one in order to decrypt the whole bio data *afterwards*.
981 */
982 clone = bio_alloc_bioset(gfp, bio_segments(base_bio), cc->bs);
982 clone = bio_clone_bioset(base_bio, gfp, cc->bs);
983 if (!clone)
984 return 1;
985
986 crypt_inc_pending(io);
987
988 clone_init(io, clone);
983 if (!clone)
984 return 1;
985
986 crypt_inc_pending(io);
987
988 clone_init(io, clone);
989 clone->bi_idx = 0;
990 clone->bi_vcnt = bio_segments(base_bio);
991 clone->bi_size = base_bio->bi_size;
992 clone->bi_sector = cc->start + io->sector;
989 clone->bi_sector = cc->start + io->sector;
993 memcpy(clone->bi_io_vec, bio_iovec(base_bio),
994 sizeof(struct bio_vec) * clone->bi_vcnt);
995
996 generic_make_request(clone);
997 return 0;
998}
999
1000static void kcryptd_io_write(struct dm_crypt_io *io)
1001{
1002 struct bio *clone = io->ctx.bio_out;

--- 894 unchanged lines hidden ---
990
991 generic_make_request(clone);
992 return 0;
993}
994
995static void kcryptd_io_write(struct dm_crypt_io *io)
996{
997 struct bio *clone = io->ctx.bio_out;

--- 894 unchanged lines hidden ---