summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorIsrael Rukshin <israelr@mellanox.com>2019-10-13 18:57:32 +0200
committerJens Axboe <axboe@kernel.dk>2019-11-04 18:56:40 +0100
commit4d764bb9a92bc63afc3befe36a0bedfddff1398a (patch)
treefe404e88b1eb4c5de305808af1a4d2d68795cda1 /drivers/nvme
parentnvme: introduce nvme_is_aen_req function (diff)
downloadlinux-4d764bb9a92bc63afc3befe36a0bedfddff1398a.tar.xz
linux-4d764bb9a92bc63afc3befe36a0bedfddff1398a.zip
nvmet: use bio_io_error instead of duplicating it
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>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/io-cmd-bdev.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c
index 32008d85172b..f2618dc2ef3a 100644
--- a/drivers/nvme/target/io-cmd-bdev.c
+++ b/drivers/nvme/target/io-cmd-bdev.c
@@ -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);
}