blk-crypto: use bio_kmalloc in blk_crypto_clone_bio
authorChristoph Hellwig <hch@lst.de>
Tue, 26 Jan 2021 14:52:33 +0000 (15:52 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Jan 2021 16:51:48 +0000 (09:51 -0700)
Use bio_kmalloc instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Acked-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-crypto-fallback.c

index 50c2253..e8327c5 100644 (file)
@@ -164,7 +164,7 @@ static struct bio *blk_crypto_clone_bio(struct bio *bio_src)
        struct bio_vec bv;
        struct bio *bio;
 
-       bio = bio_alloc_bioset(GFP_NOIO, bio_segments(bio_src), NULL);
+       bio = bio_kmalloc(GFP_NOIO, bio_segments(bio_src));
        if (!bio)
                return NULL;
        bio->bi_bdev            = bio_src->bi_bdev;