lkml.org 
[lkml]   [2014]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/4] blk-mq: handle dma_drain_size
Make blk-mq handle the dma_drain_size field the same way as the old request
path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-mq.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 40fc4dd..35800e1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -561,6 +561,16 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
list_del_init(&rq->queuelist);
blk_mq_start_request(rq);

+ if (q->dma_drain_size && blk_rq_bytes(rq)) {
+ /*
+ * make sure space for the drain appears we
+ * know we can do this because max_hw_segments
+ * has been adjusted to be one fewer than the
+ * device can handle
+ */
+ rq->nr_phys_segments++;
+ }
+
/*
* Last request in the series. Flag it as such, this
* enables drivers to know when IO should be kicked off,
--
1.7.10.4



\
 
 \ /
  Last update: 2014-02-07 20:01    [W:0.055 / U:1.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site