diff options
| author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-20 18:25:55 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-05-30 17:33:32 -0400 |
| commit | 52190f8abe7f2bf2b4e5f9760cbcc1427ca2136b (patch) | |
| tree | 4461057fe81cd05ef5217b1b562c7df9274f16dd | |
| parent | a47a28b74a5c7c27bf621276b85ad6c124651236 (diff) | |
fs: convert block_dev.c to bioset_init()
Convert block DIO code to embedded bio sets.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | fs/block_dev.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 81c57c14fae8..bef6934b6189 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -272,7 +272,7 @@ struct blkdev_dio { | |||
| 272 | struct bio bio; | 272 | struct bio bio; |
| 273 | }; | 273 | }; |
| 274 | 274 | ||
| 275 | static struct bio_set *blkdev_dio_pool __read_mostly; | 275 | static struct bio_set blkdev_dio_pool; |
| 276 | 276 | ||
| 277 | static void blkdev_bio_end_io(struct bio *bio) | 277 | static void blkdev_bio_end_io(struct bio *bio) |
| 278 | { | 278 | { |
| @@ -334,7 +334,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) | |||
| 334 | (bdev_logical_block_size(bdev) - 1)) | 334 | (bdev_logical_block_size(bdev) - 1)) |
| 335 | return -EINVAL; | 335 | return -EINVAL; |
| 336 | 336 | ||
| 337 | bio = bio_alloc_bioset(GFP_KERNEL, nr_pages, blkdev_dio_pool); | 337 | bio = bio_alloc_bioset(GFP_KERNEL, nr_pages, &blkdev_dio_pool); |
| 338 | bio_get(bio); /* extra ref for the completion handler */ | 338 | bio_get(bio); /* extra ref for the completion handler */ |
| 339 | 339 | ||
| 340 | dio = container_of(bio, struct blkdev_dio, bio); | 340 | dio = container_of(bio, struct blkdev_dio, bio); |
| @@ -432,10 +432,7 @@ blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter) | |||
| 432 | 432 | ||
| 433 | static __init int blkdev_init(void) | 433 | static __init int blkdev_init(void) |
| 434 | { | 434 | { |
| 435 | blkdev_dio_pool = bioset_create(4, offsetof(struct blkdev_dio, bio), BIOSET_NEED_BVECS); | 435 | return bioset_init(&blkdev_dio_pool, 4, offsetof(struct blkdev_dio, bio), BIOSET_NEED_BVECS); |
| 436 | if (!blkdev_dio_pool) | ||
| 437 | return -ENOMEM; | ||
| 438 | return 0; | ||
| 439 | } | 436 | } |
| 440 | module_init(blkdev_init); | 437 | module_init(blkdev_init); |
| 441 | 438 | ||
