提交 616c6a68 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

btrfs: use bio_kmalloc in __alloc_device

Use bio_kmalloc instead of open coding it.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Acked-by: NDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 f91ca2a3
...@@ -421,7 +421,7 @@ static struct btrfs_device *__alloc_device(struct btrfs_fs_info *fs_info) ...@@ -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 * Preallocate a bio that's always going to be used for flushing device
* barriers and matches the device lifespan * 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) { if (!dev->flush_bio) {
kfree(dev); kfree(dev);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册