OSDN Git Service

btrfs: use bio_kmalloc in __alloc_device
authorChristoph Hellwig <hch@lst.de>
Tue, 26 Jan 2021 14:52:32 +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: Josef Bacik <josef@toxicpanda.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>
fs/btrfs/volumes.c

index 0a6de85..584ba09 100644 (file)
@@ -421,7 +421,7 @@ static struct btrfs_device *__alloc_device(struct btrfs_fs_info *fs_info)
         * Preallocate a bio that's always going to be used for flushing device
         * barriers and matches the device lifespan
         */
-       dev->flush_bio = bio_alloc_bioset(GFP_KERNEL, 0, NULL);
+       dev->flush_bio = bio_kmalloc(GFP_KERNEL, 0);
        if (!dev->flush_bio) {
                kfree(dev);
                return ERR_PTR(-ENOMEM);