nvme: move nvme_qpair_abort_queued_reqs

Next patch will use this function earlier in the
file, so move the function now rather than in the
later patch.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453780
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@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-05-08 21:49:31 -07:00
parent a3945e8ec9
commit 63d5459656

View File

@ -387,6 +387,20 @@ nvme_qpair_manual_complete_request(struct spdk_nvme_qpair *qpair,
nvme_free_request(req);
}
static void
nvme_qpair_abort_queued_reqs(struct spdk_nvme_qpair *qpair, uint32_t dnr)
{
struct nvme_request *req;
while (!STAILQ_EMPTY(&qpair->queued_req)) {
req = STAILQ_FIRST(&qpair->queued_req);
STAILQ_REMOVE_HEAD(&qpair->queued_req, stailq);
SPDK_ERRLOG("aborting queued i/o\n");
nvme_qpair_manual_complete_request(qpair, req, SPDK_NVME_SCT_GENERIC,
SPDK_NVME_SC_ABORTED_BY_REQUEST, dnr, true);
}
}
static bool
nvme_qpair_check_enabled(struct spdk_nvme_qpair *qpair)
{
@ -575,20 +589,6 @@ nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *re
return nvme_transport_qpair_submit_request(qpair, req);
}
static void
nvme_qpair_abort_queued_reqs(struct spdk_nvme_qpair *qpair, uint32_t dnr)
{
struct nvme_request *req;
while (!STAILQ_EMPTY(&qpair->queued_req)) {
req = STAILQ_FIRST(&qpair->queued_req);
STAILQ_REMOVE_HEAD(&qpair->queued_req, stailq);
SPDK_ERRLOG("aborting queued i/o\n");
nvme_qpair_manual_complete_request(qpair, req, SPDK_NVME_SCT_GENERIC,
SPDK_NVME_SC_ABORTED_BY_REQUEST, dnr, true);
}
}
void
nvme_qpair_enable(struct spdk_nvme_qpair *qpair)
{