lightnvm: move rq->error to nvm_rq->error
authorMatias Bjørling <m@bjorling.me>
Tue, 12 Jan 2016 06:49:29 +0000 (07:49 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 12 Jan 2016 15:21:17 +0000 (08:21 -0700)
Instead of passing request error into the LightNVM modules, incorporate
it into the nvm_rq.

Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/core.c
drivers/lightnvm/gennvm.c
drivers/lightnvm/rrpc.c
include/linux/lightnvm.h

index cd674af3d17d3faf224c17b4a60492d4ab8b226e..dad84ddbefb4d5177b1dd37e96a9433aa9b09b97 100644 (file)
@@ -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);
 
index 262da6dd90568d3cb8cd73482f6a43ebc7fa02e6..4c15846b327f81d6aaa601794eecf17c857dc899 100644 (file)
@@ -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)
index ec7aacf78f2fb7c21d7e5a6f6e7aacef64a288e7..9a5d94007ec0ea355b619893289cbb30aa52c229 100644 (file)
@@ -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);
index a83298f62122d5dd2d57efdd486484d7c218aa04..9acc71a9a47f063e37dbfefeea39c107df245c87 100644 (file)
@@ -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)