diff options
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r-- | drivers/md/dm-crypt.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 664743d6a6cd..bbf459bca61d 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -798,14 +798,6 @@ static int crypt_convert(struct crypt_config *cc, | |||
798 | return 0; | 798 | return 0; |
799 | } | 799 | } |
800 | 800 | ||
801 | static void dm_crypt_bio_destructor(struct bio *bio) | ||
802 | { | ||
803 | struct dm_crypt_io *io = bio->bi_private; | ||
804 | struct crypt_config *cc = io->cc; | ||
805 | |||
806 | bio_free(bio, cc->bs); | ||
807 | } | ||
808 | |||
809 | /* | 801 | /* |
810 | * Generate a new unfragmented bio with the given size | 802 | * Generate a new unfragmented bio with the given size |
811 | * This should never violate the device limitations | 803 | * This should never violate the device limitations |
@@ -974,7 +966,6 @@ static void clone_init(struct dm_crypt_io *io, struct bio *clone) | |||
974 | clone->bi_end_io = crypt_endio; | 966 | clone->bi_end_io = crypt_endio; |
975 | clone->bi_bdev = cc->dev->bdev; | 967 | clone->bi_bdev = cc->dev->bdev; |
976 | clone->bi_rw = io->base_bio->bi_rw; | 968 | clone->bi_rw = io->base_bio->bi_rw; |
977 | clone->bi_destructor = dm_crypt_bio_destructor; | ||
978 | } | 969 | } |
979 | 970 | ||
980 | static int kcryptd_io_read(struct dm_crypt_io *io, gfp_t gfp) | 971 | static int kcryptd_io_read(struct dm_crypt_io *io, gfp_t gfp) |
@@ -988,19 +979,14 @@ static int kcryptd_io_read(struct dm_crypt_io *io, gfp_t gfp) | |||
988 | * copy the required bvecs because we need the original | 979 | * copy the required bvecs because we need the original |
989 | * one in order to decrypt the whole bio data *afterwards*. | 980 | * one in order to decrypt the whole bio data *afterwards*. |
990 | */ | 981 | */ |
991 | clone = bio_alloc_bioset(gfp, bio_segments(base_bio), cc->bs); | 982 | clone = bio_clone_bioset(base_bio, gfp, cc->bs); |
992 | if (!clone) | 983 | if (!clone) |
993 | return 1; | 984 | return 1; |
994 | 985 | ||
995 | crypt_inc_pending(io); | 986 | crypt_inc_pending(io); |
996 | 987 | ||
997 | clone_init(io, clone); | 988 | clone_init(io, clone); |
998 | clone->bi_idx = 0; | ||
999 | clone->bi_vcnt = bio_segments(base_bio); | ||
1000 | clone->bi_size = base_bio->bi_size; | ||
1001 | clone->bi_sector = cc->start + io->sector; | 989 | clone->bi_sector = cc->start + io->sector; |
1002 | memcpy(clone->bi_io_vec, bio_iovec(base_bio), | ||
1003 | sizeof(struct bio_vec) * clone->bi_vcnt); | ||
1004 | 990 | ||
1005 | generic_make_request(clone); | 991 | generic_make_request(clone); |
1006 | return 0; | 992 | return 0; |