From: Kanchan Joshi <joshi.k@samsung.com>
To: axboe@kernel.dk, hch@lst.de, kbusch@kernel.org
Cc: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org,
anuj20.g@samsung.com, javier.gonz@samsung.com,
Kanchan Joshi <joshi.k@samsung.com>
Subject: [RFC 2/3] nvme: passthrough helper with callback
Date: Tue, 2 Mar 2021 21:37:33 +0530 [thread overview]
Message-ID: <20210302160734.99610-3-joshi.k@samsung.com> (raw)
In-Reply-To: <20210302160734.99610-1-joshi.k@samsung.com>
This is a prep patch, so that ioctl completion can be decoupled from
submission.
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
---
drivers/nvme/host/core.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e68a8c4ac5a6..15c9490b593f 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1126,7 +1126,8 @@ static void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects)
}
}
-void nvme_execute_passthru_rq(struct request *rq)
+void nvme_execute_passthru_rq_common(struct request *rq,
+ rq_end_io_fn *done)
{
struct nvme_command *cmd = nvme_req(rq)->cmd;
struct nvme_ctrl *ctrl = nvme_req(rq)->ctrl;
@@ -1135,9 +1136,17 @@ void nvme_execute_passthru_rq(struct request *rq)
u32 effects;
effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
- blk_execute_rq(disk, rq, 0);
+ if (!done)
+ blk_execute_rq(disk, rq, 0);
+ else
+ blk_execute_rq_nowait(disk, rq, 0, done);
nvme_passthru_end(ctrl, effects);
}
+
+void nvme_execute_passthru_rq(struct request *rq)
+{
+ return nvme_execute_passthru_rq_common(rq, NULL);
+}
EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);
static int nvme_submit_user_cmd(struct request_queue *q,
--
2.25.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-03-03 18:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210302160907epcas5p4d04ab7c4ef4d467302498f06ed656b24@epcas5p4.samsung.com>
2021-03-02 16:07 ` [RFC 0/3] Async nvme passthrough Kanchan Joshi
2021-03-02 16:07 ` [RFC 1/3] io_uring: add helper for uring_cmd completion in submitter-task Kanchan Joshi
2021-03-02 16:07 ` Kanchan Joshi [this message]
2021-03-03 7:52 ` [RFC 2/3] nvme: passthrough helper with callback Chaitanya Kulkarni
2021-03-04 11:13 ` Kanchan Joshi
2021-03-05 4:14 ` Chaitanya Kulkarni
2021-03-05 10:40 ` Kanchan Joshi
2021-03-02 16:07 ` [RFC 3/3] nvme: wire up support for async passthrough Kanchan Joshi
2021-03-03 7:34 ` Chaitanya Kulkarni
2021-03-04 11:01 ` Kanchan Joshi
2021-03-04 22:59 ` Chaitanya Kulkarni
2021-03-05 1:46 ` Jens Axboe
2021-03-05 2:41 ` Keith Busch
2021-03-05 10:44 ` Kanchan Joshi
2021-03-05 13:17 ` hch
2021-03-03 7:35 ` Chaitanya Kulkarni
2021-03-04 10:55 ` Kanchan Joshi
2021-03-05 13:22 ` hch
2021-03-03 7:37 ` Chaitanya Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210302160734.99610-3-joshi.k@samsung.com \
--to=joshi.k@samsung.com \
--cc=anuj20.g@samsung.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=io-uring@vger.kernel.org \
--cc=javier.gonz@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox