Commit 72d256ec authored by Matias Bjørling's avatar Matias Bjørling Committed by Jens Axboe

lightnvm: move rq->error to nvm_rq->error

Instead of passing request error into the LightNVM modules, incorporate
it into the nvm_rq.
Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 81e681d3
...@@ -291,7 +291,8 @@ EXPORT_SYMBOL(nvm_erase_ppa); ...@@ -291,7 +291,8 @@ EXPORT_SYMBOL(nvm_erase_ppa);
void nvm_end_io(struct nvm_rq *rqd, int error) 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); EXPORT_SYMBOL(nvm_end_io);
......
...@@ -363,11 +363,11 @@ static void gennvm_mark_blk_bad(struct nvm_dev *dev, struct nvm_rq *rqd) ...@@ -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); 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; struct nvm_tgt_instance *ins = rqd->ins;
switch (error) { switch (rqd->error) {
case NVM_RSP_SUCCESS: case NVM_RSP_SUCCESS:
case NVM_RSP_ERR_EMPTYPAGE: case NVM_RSP_ERR_EMPTYPAGE:
break; break;
...@@ -375,7 +375,7 @@ static void gennvm_end_io(struct nvm_rq *rqd, int error) ...@@ -375,7 +375,7 @@ static void gennvm_end_io(struct nvm_rq *rqd, int error)
gennvm_mark_blk_bad(rqd->dev, rqd); 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) static int gennvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
......
...@@ -658,7 +658,7 @@ static void rrpc_end_io_write(struct rrpc *rrpc, struct rrpc_rq *rrqd, ...@@ -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 *rrpc = container_of(rqd->ins, struct rrpc, instance);
struct rrpc_rq *rrqd = nvm_rq_to_pdu(rqd); struct rrpc_rq *rrqd = nvm_rq_to_pdu(rqd);
......
...@@ -149,7 +149,7 @@ struct ppa_addr { ...@@ -149,7 +149,7 @@ struct ppa_addr {
}; };
struct nvm_rq; 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_rq {
struct nvm_tgt_instance *ins; struct nvm_tgt_instance *ins;
...@@ -173,6 +173,8 @@ struct nvm_rq { ...@@ -173,6 +173,8 @@ struct nvm_rq {
uint8_t opcode; uint8_t opcode;
uint16_t nr_pages; uint16_t nr_pages;
uint16_t flags; uint16_t flags;
int error;
}; };
static inline struct nvm_rq *nvm_rq_from_pdu(void *pdu) static inline struct nvm_rq *nvm_rq_from_pdu(void *pdu)
......
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