mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Matias Bjørling" <m@bjorling.me>
To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com
Cc: "Matias Bjørling" <m@bjorling.me>
Subject: [PATCH 15/25] lightnvm: move rq->error to nvm_rq->error
Date: Tue, 12 Jan 2016 07:49:29 +0100	[thread overview]
Message-ID: <1452581379-18162-16-git-send-email-m@bjorling.me> (raw)
In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me>

Instead of passing request error into the LightNVM modules, incorporate
it into the nvm_rq.

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/lightnvm/core.c   | 3 ++-
 drivers/lightnvm/gennvm.c | 6 +++---
 drivers/lightnvm/rrpc.c   | 2 +-
 include/linux/lightnvm.h  | 4 +++-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index cd674af..dad84dd 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -291,7 +291,8 @@ EXPORT_SYMBOL(nvm_erase_ppa);
 
 void nvm_end_io(struct nvm_rq *rqd, int error)
 {
-	rqd->end_io(rqd, error);
+	rqd->error = error;
+	rqd->end_io(rqd);
 }
 EXPORT_SYMBOL(nvm_end_io);
 
diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c
index 262da6d..4c15846 100644
--- a/drivers/lightnvm/gennvm.c
+++ b/drivers/lightnvm/gennvm.c
@@ -363,11 +363,11 @@ static void gennvm_mark_blk_bad(struct nvm_dev *dev, struct nvm_rq *rqd)
 		gennvm_blk_set_type(dev, &rqd->ppa_addr, 2);
 }
 
-static void gennvm_end_io(struct nvm_rq *rqd, int error)
+static void gennvm_end_io(struct nvm_rq *rqd)
 {
 	struct nvm_tgt_instance *ins = rqd->ins;
 
-	switch (error) {
+	switch (rqd->error) {
 	case NVM_RSP_SUCCESS:
 	case NVM_RSP_ERR_EMPTYPAGE:
 		break;
@@ -375,7 +375,7 @@ static void gennvm_end_io(struct nvm_rq *rqd, int error)
 		gennvm_mark_blk_bad(rqd->dev, rqd);
 	}
 
-	ins->tt->end_io(rqd, error);
+	ins->tt->end_io(rqd);
 }
 
 static int gennvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index ec7aacf..9a5d940 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -658,7 +658,7 @@ static void rrpc_end_io_write(struct rrpc *rrpc, struct rrpc_rq *rrqd,
 	}
 }
 
-static void rrpc_end_io(struct nvm_rq *rqd, int error)
+static void rrpc_end_io(struct nvm_rq *rqd)
 {
 	struct rrpc *rrpc = container_of(rqd->ins, struct rrpc, instance);
 	struct rrpc_rq *rrqd = nvm_rq_to_pdu(rqd);
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index a83298f..9acc71a 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -149,7 +149,7 @@ struct ppa_addr {
 };
 
 struct nvm_rq;
-typedef void (nvm_end_io_fn)(struct nvm_rq *, int);
+typedef void (nvm_end_io_fn)(struct nvm_rq *);
 
 struct nvm_rq {
 	struct nvm_tgt_instance *ins;
@@ -173,6 +173,8 @@ struct nvm_rq {
 	uint8_t opcode;
 	uint16_t nr_pages;
 	uint16_t flags;
+
+	int error;
 };
 
 static inline struct nvm_rq *nvm_rq_from_pdu(void *pdu)
-- 
2.1.4

  parent reply	other threads:[~2016-01-12  6:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12  6:49 [PATCH 00/25] LightNVM patches for 4.5 Matias Bjørling
2016-01-12  6:49 ` [PATCH 01/25] lightnvm: fix bio submission issue Matias Bjørling
2016-01-12  6:49 ` [PATCH 02/25] lightnvm: fix incorrect nr_free_blocks stat Matias Bjørling
2016-01-12  6:49 ` [PATCH 03/25] lightnvm: add check after mempool allocation Matias Bjørling
2016-01-12  6:49 ` [PATCH 04/25] lightnvm: unlock rq and free ppa_list on submission fail Matias Bjørling
2016-01-12  6:49 ` [PATCH 05/25] lightnvm: move ppa erase logic to core Matias Bjørling
2016-01-12  6:49 ` [PATCH 06/25] lightnvm: refactor rqd ppa list into set/free Matias Bjørling
2016-01-12  6:49 ` [PATCH 07/25] lightnvm: refactor end_io functions for sync Matias Bjørling
2016-01-12  6:49 ` [PATCH 08/25] lightnvm: return the get_bb_tbl return value Matias Bjørling
2016-01-12  6:49 ` [PATCH 09/25] lightnvm: check bi_error in gc Matias Bjørling
2016-01-12  6:49 ` [PATCH 10/25] lightnvm: put block back to gc list on its reclaim fail Matias Bjørling
2016-01-12  6:49 ` [PATCH 11/25] lightnvm: fix locking and mempool in rrpc_lun_gc Matias Bjørling
2016-01-12  6:49 ` [PATCH 12/25] lightnvm: sectors first in ppa list Matias Bjørling
2016-01-12  6:49 ` [PATCH 13/25] lightnvm: move the pages per block check out of the loop Matias Bjørling
2016-01-12  6:49 ` [PATCH 14/25] lightnvm: support multiple ppas in nvm_erase_ppa Matias Bjørling
2016-01-12  6:49 ` Matias Bjørling [this message]
2016-01-12  6:49 ` [PATCH 16/25] lightnvm: introduce nvm_submit_ppa Matias Bjørling
2016-01-12  6:49 ` [PATCH 17/25] lightnvm: reference rrpc lun in rrpc block Matias Bjørling
2016-01-12  6:49 ` [PATCH 18/25] lightnvm: fix missing grown bad block type Matias Bjørling
2016-01-12  6:49 ` [PATCH 19/25] lightnvm: manage open and closed blocks separately Matias Bjørling
2016-01-12  6:49 ` [PATCH 20/25] lightnvm: add mccap support Matias Bjørling
2016-01-12  6:49 ` [PATCH 21/25] lightnvm: introduce mlc lower page table mappings Matias Bjørling
2016-01-12  6:49 ` [PATCH 22/25] lightnvm: core on-disk initialization Matias Bjørling
2016-01-12  6:49 ` [PATCH 23/25] lightnvm: introduce ioctl to initialize device Matias Bjørling
2016-01-12  6:49 ` [PATCH 24/25] lightnvm: use system block for mm initialization Matias Bjørling
2016-01-12  6:49 ` [PATCH 25/25] lightnvm: introduce factory reset Matias Bjørling
2016-01-12 15:19 ` [PATCH 00/25] LightNVM patches for 4.5 Jens Axboe
2016-01-13  0:09   ` Matias Bjorling

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=1452581379-18162-16-git-send-email-m@bjorling.me \
    --to=m@bjorling.me \
    --cc=axboe@fb.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®