[dm-devel] [PATCH V8 01/11] block: clone nr_integrity_segments and write_hint in blk_rq_prep_clone

Ming Lei ming.lei at redhat.com
Fri Apr 24 10:23:41 UTC 2020


So far blk_rq_prep_clone() is only used for setup one underlying cloned
request from dm-rq request. block intetrity can be enabled for both dm-rq
and the underlying queues, so it is reasonable to clone rq's
nr_integrity_segments. Also write_hint is from bio, it should have been
cloned too.

So clone nr_integrity_segments and write_hint in blk_rq_prep_clone.

Cc: John Garry <john.garry at huawei.com>
Cc: Bart Van Assche <bvanassche at acm.org>
Cc: Hannes Reinecke <hare at suse.com>
Cc: Christoph Hellwig <hch at lst.de>
Cc: Thomas Gleixner <tglx at linutronix.de>
Cc: Mike Snitzer <snitzer at redhat.com>
Cc: dm-devel at redhat.com
Signed-off-by: Ming Lei <ming.lei at redhat.com>
---
 block/blk-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index 7e4a1da0715e..91537e526b45 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1636,9 +1636,13 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
 		rq->rq_flags |= RQF_SPECIAL_PAYLOAD;
 		rq->special_vec = rq_src->special_vec;
 	}
+#ifdef CONFIG_BLK_DEV_INTEGRITY
+	rq->nr_integrity_segments = rq_src->nr_integrity_segments;
+#endif
 	rq->nr_phys_segments = rq_src->nr_phys_segments;
 	rq->ioprio = rq_src->ioprio;
 	rq->extra_len = rq_src->extra_len;
+	rq->write_hint = rq_src->write_hint;
 
 	return 0;
 
-- 
2.25.2




More information about the dm-devel mailing list