block: add a bi_error field to struct bio
[linux-2.6-block.git] / drivers / md / bcache / btree.c
index 00cde40db57269bb173104ab3632b8a99e95c4f6..83392f856dfd5d86e67cc636ab61e0fb0f16750d 100644 (file)
@@ -278,7 +278,7 @@ err:
        goto out;
 }
 
-static void btree_node_read_endio(struct bio *bio, int error)
+static void btree_node_read_endio(struct bio *bio)
 {
        struct closure *cl = bio->bi_private;
        closure_put(cl);
@@ -305,7 +305,7 @@ static void bch_btree_node_read(struct btree *b)
        bch_submit_bbio(bio, b->c, &b->key, 0);
        closure_sync(&cl);
 
-       if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
+       if (bio->bi_error)
                set_btree_node_io_error(b);
 
        bch_bbio_free(bio, b->c);
@@ -371,15 +371,15 @@ static void btree_node_write_done(struct closure *cl)
        __btree_node_write_done(cl);
 }
 
-static void btree_node_write_endio(struct bio *bio, int error)
+static void btree_node_write_endio(struct bio *bio)
 {
        struct closure *cl = bio->bi_private;
        struct btree *b = container_of(cl, struct btree, io);
 
-       if (error)
+       if (bio->bi_error)
                set_btree_node_io_error(b);
 
-       bch_bbio_count_io_errors(b->c, bio, error, "writing btree");
+       bch_bbio_count_io_errors(b->c, bio, bio->bi_error, "writing btree");
        closure_put(cl);
 }