]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/md/bcache/request.c
block: switch bios to blk_status_t
[mirror_ubuntu-bionic-kernel.git] / drivers / md / bcache / request.c
index 709c9cc34369fe5c0e0b206673debfcf0c3efe4f..019b3df9f1c603be4a7d2ad0b6d1de05ad6a2711 100644 (file)
@@ -81,7 +81,7 @@ static void bch_data_insert_keys(struct closure *cl)
        if (ret == -ESRCH) {
                op->replace_collision = true;
        } else if (ret) {
-               op->error               = -ENOMEM;
+               op->status              = BLK_STS_RESOURCE;
                op->insert_data_done    = true;
        }
 
@@ -178,17 +178,17 @@ static void bch_data_insert_endio(struct bio *bio)
        struct closure *cl = bio->bi_private;
        struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
 
-       if (bio->bi_error) {
+       if (bio->bi_status) {
                /* TODO: We could try to recover from this. */
                if (op->writeback)
-                       op->error = bio->bi_error;
+                       op->status = bio->bi_status;
                else if (!op->replace)
                        set_closure_fn(cl, bch_data_insert_error, op->wq);
                else
                        set_closure_fn(cl, NULL, NULL);
        }
 
-       bch_bbio_endio(op->c, bio, bio->bi_error, "writing data to cache");
+       bch_bbio_endio(op->c, bio, bio->bi_status, "writing data to cache");
 }
 
 static void bch_data_insert_start(struct closure *cl)
@@ -488,15 +488,15 @@ static void bch_cache_read_endio(struct bio *bio)
         * from the backing device.
         */
 
-       if (bio->bi_error)
-               s->iop.error = bio->bi_error;
+       if (bio->bi_status)
+               s->iop.status = bio->bi_status;
        else if (!KEY_DIRTY(&b->key) &&
                 ptr_stale(s->iop.c, &b->key, 0)) {
                atomic_long_inc(&s->iop.c->cache_read_races);
-               s->iop.error = -EINTR;
+               s->iop.status = BLK_STS_IOERR;
        }
 
-       bch_bbio_endio(s->iop.c, bio, bio->bi_error, "reading from cache");
+       bch_bbio_endio(s->iop.c, bio, bio->bi_status, "reading from cache");
 }
 
 /*
@@ -593,9 +593,9 @@ static void request_endio(struct bio *bio)
 {
        struct closure *cl = bio->bi_private;
 
-       if (bio->bi_error) {
+       if (bio->bi_status) {
                struct search *s = container_of(cl, struct search, cl);
-               s->iop.error = bio->bi_error;
+               s->iop.status = bio->bi_status;
                /* Only cache read errors are recoverable */
                s->recoverable = false;
        }
@@ -611,7 +611,7 @@ static void bio_complete(struct search *s)
                                    &s->d->disk->part0, s->start_time);
 
                trace_bcache_request_end(s->d, s->orig_bio);
-               s->orig_bio->bi_error = s->iop.error;
+               s->orig_bio->bi_status = s->iop.status;
                bio_endio(s->orig_bio);
                s->orig_bio = NULL;
        }
@@ -664,7 +664,7 @@ static inline struct search *search_alloc(struct bio *bio,
        s->iop.inode            = d->id;
        s->iop.write_point      = hash_long((unsigned long) current, 16);
        s->iop.write_prio       = 0;
-       s->iop.error            = 0;
+       s->iop.status           = 0;
        s->iop.flags            = 0;
        s->iop.flush_journal    = op_is_flush(bio->bi_opf);
        s->iop.wq               = bcache_wq;
@@ -707,7 +707,7 @@ static void cached_dev_read_error(struct closure *cl)
                /* Retry from the backing device: */
                trace_bcache_read_retry(s->orig_bio);
 
-               s->iop.error = 0;
+               s->iop.status = 0;
                do_bio_hook(s, s->orig_bio);
 
                /* XXX: invalidate cache */
@@ -767,7 +767,7 @@ static void cached_dev_read_done_bh(struct closure *cl)
                                  !s->cache_miss, s->iop.bypass);
        trace_bcache_read(s->orig_bio, !s->cache_miss, s->iop.bypass);
 
-       if (s->iop.error)
+       if (s->iop.status)
                continue_at_nobarrier(cl, cached_dev_read_error, bcache_wq);
        else if (s->iop.bio || verify(dc, &s->bio.bio))
                continue_at_nobarrier(cl, cached_dev_read_done, bcache_wq);