summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-11 21:29:44 +0300
committerJens Axboe <axboe@kernel.dk>2021-02-11 21:29:44 +0300
commit65fb1b0dbce84aaded750cbb6a8cb7783ae601eb (patch)
tree3392d90094be2105bfb3e743e5db103d32409055 /include
parent597886836164ef18b76faea7304357556fe29da9 (diff)
parente11e5116171dedeaf63735931e72ad5de0f30ed5 (diff)
downloadlinux-65fb1b0dbce84aaded750cbb6a8cb7783ae601eb.tar.xz
Merge tag 'nvme-5.12-2021-02-11' of git://git.infradead.org/nvme into for-5.12/drivers
Pull NVMe updates from Christoph: "nvme updates for 5.12: - fix multipath handling of ->queue_rq errors (Chao Leng) - nvmet cleanups (Chaitanya Kulkarni) - add a quirk for buggy Amazon controller (Filippo Sironi) - avoid devm allocations in nvme-hwmon that don't interact well with fabrics (Hannes Reinecke) - sysfs cleanups (Jiapeng Chong) - fix nr_zones for multipath (Keith Busch) - nvme-tcp crash fix for no-data commands (Sagi Grimberg) - nvmet-tcp fixes (Sagi Grimberg) - add a missing __rcu annotation (me)" * tag 'nvme-5.12-2021-02-11' of git://git.infradead.org/nvme: (22 commits) nvme-tcp: fix crash triggered with a dataless request submission nvme: add 48-bit DMA address quirk for Amazon NVMe controllers nvme-hwmon: rework to avoid devm allocation nvmet: remove else at the end of the function nvmet: add nvmet_req_subsys() helper nvmet: use min of device_path and disk len nvmet: use invalid cmd opcode helper nvmet: use invalid cmd opcode helper nvmet: add helper to report invalid opcode nvmet: remove extra variable in id-ns handler nvmet: make nvmet_find_namespace() req based nvmet: return uniform error for invalid ns nvmet: set status to 0 in case for invalid nsid nvmet-fc: add a missing __rcu annotation to nvmet_fc_tgt_assoc.queues nvme-multipath: set nr_zones for zoned namespaces nvmet-tcp: fix potential race of tcp socket closing accept_work nvmet-tcp: fix receive data digest calculation for multiple h2cdata PDUs nvme-rdma: handle nvme_rdma_post_send failures better nvme-fabrics: avoid double completions in nvmf_fail_nonready_command nvme: introduce a nvme_host_path_error helper ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/blk-mq.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index aabbf6830ffc..2c473c9b8990 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -490,6 +490,18 @@ static inline int blk_mq_request_completed(struct request *rq)
return blk_mq_rq_state(rq) == MQ_RQ_COMPLETE;
}
+/*
+ *
+ * Set the state to complete when completing a request from inside ->queue_rq.
+ * This is used by drivers that want to ensure special complete actions that
+ * need access to the request are called on failure, e.g. by nvme for
+ * multipathing.
+ */
+static inline void blk_mq_set_request_complete(struct request *rq)
+{
+ WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
+}
+
void blk_mq_start_request(struct request *rq);
void blk_mq_end_request(struct request *rq, blk_status_t error);
void __blk_mq_end_request(struct request *rq, blk_status_t error);