nvme: simplify logic for whether to call callback
No change in behavior, just a simplification. We already have a check for retry, so pull the cb_fn check out and put it under the !retry branch. This makes it clearer that requests that are going to be retried will not get their callbacks called. Change-Id: I70c7067e550c7fca78b0441b5474833f73863315 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
e098976c55
commit
8d424e6e71
@ -317,14 +317,14 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr,
|
|||||||
|
|
||||||
nvme_assert(cpl->cid == req->cmd.cid, ("cpl cid does not match cmd cid\n"));
|
nvme_assert(cpl->cid == req->cmd.cid, ("cpl cid does not match cmd cid\n"));
|
||||||
|
|
||||||
if (req->cb_fn && !retry) {
|
|
||||||
req->cb_fn(req->cb_arg, cpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (retry) {
|
if (retry) {
|
||||||
req->retries++;
|
req->retries++;
|
||||||
nvme_qpair_submit_tracker(qpair, tr);
|
nvme_qpair_submit_tracker(qpair, tr);
|
||||||
} else {
|
} else {
|
||||||
|
if (req->cb_fn) {
|
||||||
|
req->cb_fn(req->cb_arg, cpl);
|
||||||
|
}
|
||||||
|
|
||||||
nvme_free_request(req);
|
nvme_free_request(req);
|
||||||
tr->req = NULL;
|
tr->req = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user