All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Matias Bjørling" <m@bjorling.me>
Subject: [PATCH RFC 3/5] lightnvm: add sync support for submit_io
Date: Mon, 14 Dec 2015 14:17:05 +0100	[thread overview]
Message-ID: <1450099027-24745-4-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1450099027-24745-1-git-send-email-m@bjorling.me>

Allow read and write I/Os to be issued synchronous. Users include the
LightNVM core to implement system block support and similar.

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/nvme/host/lightnvm.c | 7 +++++++
 include/linux/lightnvm.h     | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 15f2acb..1454e53 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -496,6 +496,13 @@ static int nvme_nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
 	rq->cmd_len = sizeof(struct nvme_nvm_command);
 	rq->special = (void *)0;
 
+	if (rqd->flags & NVM_IO_F_SYNC) {
+		int err = blk_execute_rq(q, NULL, rq, 0);
+		kfree(cmd);
+		blk_mq_free_request(rq);
+		return err;
+	}
+
 	rq->end_io_data = rqd;
 
 	blk_execute_rq_nowait(q, NULL, rq, 0, nvme_nvm_end_io);
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index 2fd6871..770278a 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -60,6 +60,9 @@ enum {
 	NVM_BLK_T_BAD		= 0x1,
 	NVM_BLK_T_DEV		= 0x2,
 	NVM_BLK_T_HOST		= 0x4,
+
+	/* NVM Request Flags */
+	NVM_IO_F_SYNC		= 0x1,
 };
 
 struct nvm_id_group {
-- 
2.1.4


  parent reply	other threads:[~2015-12-14 13:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 13:17 [PATCH RFC 0/5] lightnvm: Introduce System Blocks Matias Bjørling
2015-12-14 13:17 ` [PATCH RFC 1/5] lightnvm: move ppa erase logic to core Matias Bjørling
2015-12-14 13:17 ` [PATCH RFC 2/5] lightnvm: refactor rqd ppa list into set/free Matias Bjørling
2015-12-14 13:17 ` Matias Bjørling [this message]
2015-12-15 12:34   ` [PATCH RFC 3/5] lightnvm: add sync support for submit_io Christoph Hellwig
2015-12-15 14:10     ` Matias Bjørling
2015-12-14 13:17 ` [PATCH RFC 4/5] lightnvm: introduce nvm_submit_ppa Matias Bjørling
2015-12-14 13:17 ` [PATCH RFC 5/5] lightnvm: core on-disk initialization Matias Bjørling

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=1450099027-24745-4-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.