diff options
author | Ming Lin <ming.l@samsung.com> | 2016-05-18 17:05:02 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-06-07 15:43:02 -0400 |
commit | c55a2fd4bb16bcdd8c42e3d64fccd326416b7492 (patch) | |
tree | e44e6da1c8bc384fa0bde85e078fd481073487be /drivers/nvme/host/pci.c | |
parent | e1958e6534a2d4ebb2dfcd0b3f16ff8e277a5b0c (diff) |
nvme: move nvme_cancel_request() to common code
So it can be used by fabrics driver also.
Signed-off-by: Ming Lin <ming.l@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Keith Busch <keith.bsuch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r-- | drivers/nvme/host/pci.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 4af61c909353..37aa25046eb8 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -919,22 +919,6 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved) | |||
919 | return BLK_EH_RESET_TIMER; | 919 | return BLK_EH_RESET_TIMER; |
920 | } | 920 | } |
921 | 921 | ||
922 | static void nvme_cancel_request(struct request *req, void *data, bool reserved) | ||
923 | { | ||
924 | int status; | ||
925 | |||
926 | if (!blk_mq_request_started(req)) | ||
927 | return; | ||
928 | |||
929 | dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device, | ||
930 | "Cancelling I/O %d", req->tag); | ||
931 | |||
932 | status = NVME_SC_ABORT_REQ; | ||
933 | if (blk_queue_dying(req->q)) | ||
934 | status |= NVME_SC_DNR; | ||
935 | blk_mq_complete_request(req, status); | ||
936 | } | ||
937 | |||
938 | static void nvme_free_queue(struct nvme_queue *nvmeq) | 922 | static void nvme_free_queue(struct nvme_queue *nvmeq) |
939 | { | 923 | { |
940 | dma_free_coherent(nvmeq->q_dmadev, CQ_SIZE(nvmeq->q_depth), | 924 | dma_free_coherent(nvmeq->q_dmadev, CQ_SIZE(nvmeq->q_depth), |