nvme: simplify some tracker accesses

There are several places where we have the tracker
pointer, yet we go find the tracker again by getting
the tr->cid and using that index to find the tracker
again in the qpair's array.  That's really silly.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I54acd642a2c9821f2b95e17563904b859495081a

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450308
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2019-04-05 07:45:37 -07:00
parent 18b3e74186
commit 8bc6e3c595

View File

@ -1238,7 +1238,7 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke
req = tr->req;
assert(req != NULL);
pqpair->tr[tr->cid].active = true;
tr->active = true;
/* Copy the command from the tracker to the submission queue. */
nvme_pcie_copy_command(&pqpair->cmd[pqpair->sq_tail], &req->cmd);
@ -1278,8 +1278,8 @@ nvme_pcie_qpair_complete_tracker(struct spdk_nvme_qpair *qpair, struct nvme_trac
nvme_qpair_print_completion(qpair, cpl);
}
was_active = pqpair->tr[cpl->cid].active;
pqpair->tr[cpl->cid].active = false;
was_active = tr->active;
tr->active = false;
assert(cpl->cid == req->cmd.cid);