diff options
-rw-r--r-- | drivers/md/bcache/bcache.h | 2 | ||||
-rw-r--r-- | drivers/md/bcache/btree.c | 7 | ||||
-rw-r--r-- | drivers/md/bcache/io.c | 13 | ||||
-rw-r--r-- | drivers/md/bcache/request.c | 2 |
4 files changed, 16 insertions, 8 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index 380fd1e7528b..486da65277df 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h @@ -1010,7 +1010,7 @@ void __bch_bbio_prep(struct bio *, struct cache_set *); void bch_bbio_prep(struct bio *, struct cache_set *, struct bkey *, unsigned); void bch_submit_bbio(struct bio *, struct cache_set *, struct bkey *, unsigned); void bch_submit_bbio_replicas(struct bio *, struct cache_set *, - struct bkey *, unsigned long *); + struct bkey *, unsigned long *, bool); __printf(2, 3) bool bch_cache_set_error(struct cache_set *, const char *, ...); diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index b56cac2149e5..1e9bf59d2849 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -440,8 +440,8 @@ static void do_btree_node_write(struct btree *b) memcpy(page_address(bv->bv_page), base + j * PAGE_SIZE, PAGE_SIZE); - - bch_submit_bbio_replicas(b->bio, b->c, &k.key, ptrs_to_write); + bch_submit_bbio_replicas(b->bio, b->c, &k.key, + ptrs_to_write, true); continue_at(cl, btree_node_write_done, NULL); } else { trace_bcache_btree_write_sync(b); @@ -449,7 +449,8 @@ static void do_btree_node_write(struct btree *b) b->bio->bi_vcnt = 0; bch_bio_map(b->bio, i); - bch_submit_bbio_replicas(b->bio, b->c, &k.key, ptrs_to_write); + bch_submit_bbio_replicas(b->bio, b->c, &k.key, + ptrs_to_write, true); closure_sync(cl); continue_at_nobarrier(cl, __btree_node_write_done, NULL); diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index de739142ea50..c1e2b4fbdf6d 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c @@ -90,7 +90,8 @@ void bch_submit_bbio(struct bio *bio, struct cache_set *c, } void bch_submit_bbio_replicas(struct bio *bio_src, struct cache_set *c, - struct bkey *k, unsigned long *ptrs_to_write) + struct bkey *k, unsigned long *ptrs_to_write, + bool punt) { struct bio *bio; unsigned first, i; @@ -105,11 +106,17 @@ void bch_submit_bbio_replicas(struct bio *bio_src, struct cache_set *c, bio->bi_private = bio_src->bi_private; bch_bbio_prep(bio, c, k, i); - closure_bio_submit_punt(bio, bio->bi_private, c); + if (punt) + closure_bio_submit_punt(bio, bio->bi_private, c); + else + closure_bio_submit(bio, bio->bi_private); } bch_bbio_prep(bio_src, c, k, first); - closure_bio_submit_punt(bio_src, bio_src->bi_private, c); + if (punt) + closure_bio_submit_punt(bio_src, bio_src->bi_private, c); + else + closure_bio_submit(bio_src, bio_src->bi_private); } /* IO errors */ diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index dc660b73a9a7..8368223d4c0d 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -302,7 +302,7 @@ static void bch_data_insert_start(struct closure *cl) trace_bcache_cache_insert(k); bio_set_op_attrs(n, REQ_OP_WRITE, 0); - bch_submit_bbio_replicas(n, op->c, k, ptrs_to_write); + bch_submit_bbio_replicas(n, op->c, k, ptrs_to_write, false); bch_extent_normalize(op->c, k); bch_keylist_push(&op->insert_keys); |