Commit 40174154 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme-lightnvm: use blk_execute_rq in nvme_nvm_submit_user_cmd

Instead of reinventing it poorly.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <Bart.VanAssche@sandisk.com>
Reviewed-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent dc88e34d
...@@ -571,13 +571,6 @@ static struct nvm_dev_ops nvme_nvm_dev_ops = { ...@@ -571,13 +571,6 @@ static struct nvm_dev_ops nvme_nvm_dev_ops = {
.max_phys_sect = 64, .max_phys_sect = 64,
}; };
static void nvme_nvm_end_user_vio(struct request *rq, int error)
{
struct completion *waiting = rq->end_io_data;
complete(waiting);
}
static int nvme_nvm_submit_user_cmd(struct request_queue *q, static int nvme_nvm_submit_user_cmd(struct request_queue *q,
struct nvme_ns *ns, struct nvme_ns *ns,
struct nvme_nvm_command *vcmd, struct nvme_nvm_command *vcmd,
...@@ -608,7 +601,6 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q, ...@@ -608,7 +601,6 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
rq->timeout = timeout ? timeout : ADMIN_TIMEOUT; rq->timeout = timeout ? timeout : ADMIN_TIMEOUT;
rq->cmd_flags &= ~REQ_FAILFAST_DRIVER; rq->cmd_flags &= ~REQ_FAILFAST_DRIVER;
rq->end_io_data = &wait;
if (ppa_buf && ppa_len) { if (ppa_buf && ppa_len) {
ppa_list = dma_pool_alloc(dev->dma_pool, GFP_KERNEL, &ppa_dma); ppa_list = dma_pool_alloc(dev->dma_pool, GFP_KERNEL, &ppa_dma);
...@@ -662,9 +654,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q, ...@@ -662,9 +654,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
} }
submit: submit:
blk_execute_rq_nowait(q, NULL, rq, 0, nvme_nvm_end_user_vio); blk_execute_rq(q, NULL, rq, 0);
wait_for_completion_io(&wait);
if (nvme_req(rq)->flags & NVME_REQ_CANCELLED) if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
ret = -EINTR; ret = -EINTR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment