nvmet: use bio_io_error instead of duplicating it
authorIsrael Rukshin <israelr@mellanox.com>
Sun, 13 Oct 2019 16:57:32 +0000 (19:57 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 4 Nov 2019 17:56:40 +0000 (10:56 -0700)
This commit doesn't change any logic.

Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/io-cmd-bdev.c

index 32008d8..f2618dc 100644 (file)
@@ -261,12 +261,10 @@ static void nvmet_bdev_execute_discard(struct nvmet_req *req)
        if (bio) {
                bio->bi_private = req;
                bio->bi_end_io = nvmet_bio_done;
-               if (status) {
-                       bio->bi_status = BLK_STS_IOERR;
-                       bio_endio(bio);
-               } else {
+               if (status)
+                       bio_io_error(bio);
+               else
                        submit_bio(bio);
-               }
        } else {
                nvmet_req_complete(req, status);
        }