diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2017-06-15 17:13:15 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-08-09 15:09:42 +0200 |
commit | a3c1a2194a7c776c08ad704cd8a3b3ea694c60e6 (patch) | |
tree | d4dd56947221acb864d9ef6b213ab7421c4cb957 | |
parent | s390/pci: log changes to uid checking (diff) | |
download | linux-a3c1a2194a7c776c08ad704cd8a3b3ea694c60e6.tar.xz linux-a3c1a2194a7c776c08ad704cd8a3b3ea694c60e6.zip |
s390/scm: use common completion path
Since commit caf7df122721 ("block: remove the errors field from struct request")
rq->errors can't be (mis)used by block device drivers to store the error
condition for usage during async completion. Because of that I simply used
async completion only for the non-error paths.
This patch places the error within the private data of struct request and
uses async completion for all paths again.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/block/scm_blk.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index 0071febac9e6..2e7fd966c515 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm_blk.c @@ -249,13 +249,13 @@ static void scm_request_requeue(struct scm_request *scmrq) static void scm_request_finish(struct scm_request *scmrq) { struct scm_blk_dev *bdev = scmrq->bdev; + int *error; int i; for (i = 0; i < nr_requests_per_io && scmrq->request[i]; i++) { - if (scmrq->error) - blk_mq_end_request(scmrq->request[i], scmrq->error); - else - blk_mq_complete_request(scmrq->request[i]); + error = blk_mq_rq_to_pdu(scmrq->request[i]); + *error = scmrq->error; + blk_mq_complete_request(scmrq->request[i]); } atomic_dec(&bdev->queued_reqs); @@ -415,7 +415,9 @@ void scm_blk_irq(struct scm_device *scmdev, void *data, blk_status_t error) static void scm_blk_request_done(struct request *req) { - blk_mq_end_request(req, 0); + int *error = blk_mq_rq_to_pdu(req); + + blk_mq_end_request(req, *error); } static const struct block_device_operations scm_blk_devops = { @@ -448,6 +450,7 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev) atomic_set(&bdev->queued_reqs, 0); bdev->tag_set.ops = &scm_mq_ops; + bdev->tag_set.cmd_size = sizeof(int); bdev->tag_set.nr_hw_queues = nr_requests; bdev->tag_set.queue_depth = nr_requests_per_io * nr_requests; bdev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; |