diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-20 18:25:51 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-30 17:33:32 -0400 |
commit | d19936a26658a7a53edd5619d631ee2c2c3151a2 (patch) | |
tree | 376defd02af45bfee0462727fd7ed0eefcb2e712 /drivers/md/bcache/request.c | |
parent | b906bbb6997785d9ea0bd3f5585537afa6257c43 (diff) |
bcache: convert to bioset_init()/mempool_init()
Convert bcache to embedded bio sets.
Reviewed-by: Coly Li <colyli@suse.de>
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r-- | drivers/md/bcache/request.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 8e3e8655ed63..ae67f5fa8047 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -213,7 +213,7 @@ static void bch_data_insert_start(struct closure *cl) | |||
213 | do { | 213 | do { |
214 | unsigned i; | 214 | unsigned i; |
215 | struct bkey *k; | 215 | struct bkey *k; |
216 | struct bio_set *split = op->c->bio_split; | 216 | struct bio_set *split = &op->c->bio_split; |
217 | 217 | ||
218 | /* 1 for the device pointer and 1 for the chksum */ | 218 | /* 1 for the device pointer and 1 for the chksum */ |
219 | if (bch_keylist_realloc(&op->insert_keys, | 219 | if (bch_keylist_realloc(&op->insert_keys, |
@@ -548,7 +548,7 @@ static int cache_lookup_fn(struct btree_op *op, struct btree *b, struct bkey *k) | |||
548 | 548 | ||
549 | n = bio_next_split(bio, min_t(uint64_t, INT_MAX, | 549 | n = bio_next_split(bio, min_t(uint64_t, INT_MAX, |
550 | KEY_OFFSET(k) - bio->bi_iter.bi_sector), | 550 | KEY_OFFSET(k) - bio->bi_iter.bi_sector), |
551 | GFP_NOIO, s->d->bio_split); | 551 | GFP_NOIO, &s->d->bio_split); |
552 | 552 | ||
553 | bio_key = &container_of(n, struct bbio, bio)->key; | 553 | bio_key = &container_of(n, struct bbio, bio)->key; |
554 | bch_bkey_copy_single_ptr(bio_key, k, ptr); | 554 | bch_bkey_copy_single_ptr(bio_key, k, ptr); |
@@ -707,7 +707,7 @@ static void search_free(struct closure *cl) | |||
707 | 707 | ||
708 | bio_complete(s); | 708 | bio_complete(s); |
709 | closure_debug_destroy(cl); | 709 | closure_debug_destroy(cl); |
710 | mempool_free(s, s->d->c->search); | 710 | mempool_free(s, &s->d->c->search); |
711 | } | 711 | } |
712 | 712 | ||
713 | static inline struct search *search_alloc(struct bio *bio, | 713 | static inline struct search *search_alloc(struct bio *bio, |
@@ -715,7 +715,7 @@ static inline struct search *search_alloc(struct bio *bio, | |||
715 | { | 715 | { |
716 | struct search *s; | 716 | struct search *s; |
717 | 717 | ||
718 | s = mempool_alloc(d->c->search, GFP_NOIO); | 718 | s = mempool_alloc(&d->c->search, GFP_NOIO); |
719 | 719 | ||
720 | closure_init(&s->cl, NULL); | 720 | closure_init(&s->cl, NULL); |
721 | do_bio_hook(s, bio, request_endio); | 721 | do_bio_hook(s, bio, request_endio); |
@@ -864,7 +864,7 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s, | |||
864 | s->cache_missed = 1; | 864 | s->cache_missed = 1; |
865 | 865 | ||
866 | if (s->cache_miss || s->iop.bypass) { | 866 | if (s->cache_miss || s->iop.bypass) { |
867 | miss = bio_next_split(bio, sectors, GFP_NOIO, s->d->bio_split); | 867 | miss = bio_next_split(bio, sectors, GFP_NOIO, &s->d->bio_split); |
868 | ret = miss == bio ? MAP_DONE : MAP_CONTINUE; | 868 | ret = miss == bio ? MAP_DONE : MAP_CONTINUE; |
869 | goto out_submit; | 869 | goto out_submit; |
870 | } | 870 | } |
@@ -887,14 +887,14 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s, | |||
887 | 887 | ||
888 | s->iop.replace = true; | 888 | s->iop.replace = true; |
889 | 889 | ||
890 | miss = bio_next_split(bio, sectors, GFP_NOIO, s->d->bio_split); | 890 | miss = bio_next_split(bio, sectors, GFP_NOIO, &s->d->bio_split); |
891 | 891 | ||
892 | /* btree_search_recurse()'s btree iterator is no good anymore */ | 892 | /* btree_search_recurse()'s btree iterator is no good anymore */ |
893 | ret = miss == bio ? MAP_DONE : -EINTR; | 893 | ret = miss == bio ? MAP_DONE : -EINTR; |
894 | 894 | ||
895 | cache_bio = bio_alloc_bioset(GFP_NOWAIT, | 895 | cache_bio = bio_alloc_bioset(GFP_NOWAIT, |
896 | DIV_ROUND_UP(s->insert_bio_sectors, PAGE_SECTORS), | 896 | DIV_ROUND_UP(s->insert_bio_sectors, PAGE_SECTORS), |
897 | dc->disk.bio_split); | 897 | &dc->disk.bio_split); |
898 | if (!cache_bio) | 898 | if (!cache_bio) |
899 | goto out_submit; | 899 | goto out_submit; |
900 | 900 | ||
@@ -1008,7 +1008,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) | |||
1008 | struct bio *flush; | 1008 | struct bio *flush; |
1009 | 1009 | ||
1010 | flush = bio_alloc_bioset(GFP_NOIO, 0, | 1010 | flush = bio_alloc_bioset(GFP_NOIO, 0, |
1011 | dc->disk.bio_split); | 1011 | &dc->disk.bio_split); |
1012 | if (!flush) { | 1012 | if (!flush) { |
1013 | s->iop.status = BLK_STS_RESOURCE; | 1013 | s->iop.status = BLK_STS_RESOURCE; |
1014 | goto insert_data; | 1014 | goto insert_data; |
@@ -1021,7 +1021,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) | |||
1021 | closure_bio_submit(s->iop.c, flush, cl); | 1021 | closure_bio_submit(s->iop.c, flush, cl); |
1022 | } | 1022 | } |
1023 | } else { | 1023 | } else { |
1024 | s->iop.bio = bio_clone_fast(bio, GFP_NOIO, dc->disk.bio_split); | 1024 | s->iop.bio = bio_clone_fast(bio, GFP_NOIO, &dc->disk.bio_split); |
1025 | /* I/O request sent to backing device */ | 1025 | /* I/O request sent to backing device */ |
1026 | bio->bi_end_io = backing_request_endio; | 1026 | bio->bi_end_io = backing_request_endio; |
1027 | closure_bio_submit(s->iop.c, bio, cl); | 1027 | closure_bio_submit(s->iop.c, bio, cl); |