[Devel] [PATCH RH8 48/61] dm: Introduce dm_request_set_error()

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 14 18:58:54 MSK 2021


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-map.c |    1 +
 drivers/md/dm-rq.c        |    8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 54ed057b10f3..2e9cc5f5813f 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -32,6 +32,7 @@
  * become handled in ploop_map() as before.
  */
 
+extern void dm_request_set_error(struct request *rq, blk_status_t error);
 static int ploop_endio(struct ploop *ploop, struct pio *pio);
 
 #define DM_MSG_PREFIX "ploop"
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 20745e2e34b9..c9ae771783ae 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -284,6 +284,14 @@ static void dm_complete_request(struct request *rq, blk_status_t error)
 	blk_mq_complete_request(rq);
 }
 
+void dm_request_set_error(struct request *rq, blk_status_t error)
+{
+	struct dm_rq_target_io *tio = tio_from_request(rq);
+
+	tio->error = error;
+}
+EXPORT_SYMBOL_GPL(dm_request_set_error);
+
 /*
  * Complete the not-mapped clone and the original request with the error status
  * through softirq context.




More information about the Devel mailing list