summaryrefslogtreecommitdiff
path: root/libbcachefs/io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-04-05 17:31:05 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2017-04-05 18:20:50 -0800
commit2615d73a7428a08abdd058c875067847bf93d55c (patch)
treee65a58885a8c6c535b6576c8c44cbac6a38829d1 /libbcachefs/io.c
parentbc85a9411404d979feff56680509ef28e93ab2a9 (diff)
Allow disk commands to specify member by index
Diffstat (limited to 'libbcachefs/io.c')
-rw-r--r--libbcachefs/io.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libbcachefs/io.c b/libbcachefs/io.c
index 44082a0e..0a64f35d 100644
--- a/libbcachefs/io.c
+++ b/libbcachefs/io.c
@@ -112,7 +112,6 @@ void bch2_submit_wbio_replicas(struct bch_write_bio *wbio, struct bch_fs *c,
n->bounce = false;
n->split = true;
n->put_bio = true;
- n->have_io_ref = true;
n->bio.bi_opf = wbio->bio.bi_opf;
__bio_inc_remaining(n->orig);
} else {
@@ -127,7 +126,8 @@ void bch2_submit_wbio_replicas(struct bch_write_bio *wbio, struct bch_fs *c,
n->bio.bi_iter.bi_sector = ptr->offset;
if (likely(percpu_ref_tryget(&ca->io_ref))) {
- n->bio.bi_bdev = ca->disk_sb.bdev;
+ n->have_io_ref = true;
+ n->bio.bi_bdev = ca->disk_sb.bdev;
generic_make_request(&n->bio);
} else {
n->have_io_ref = false;
@@ -315,9 +315,8 @@ static void bch2_write_endio(struct bio *bio)
struct bch_dev *ca = wbio->ca;
if (bch2_dev_nonfatal_io_err_on(bio->bi_error, ca,
- "data write")) {
+ "data write"))
set_closure_fn(cl, bch2_write_io_error, index_update_wq(op));
- }
if (wbio->have_io_ref)
percpu_ref_put(&ca->io_ref);