summaryrefslogtreecommitdiffstats
path: root/block/mq-deadline.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-06 06:29:01 -0400
committerJens Axboe <axboe@kernel.dk>2019-06-20 12:29:22 -0400
commit14ccb66b3f585b2bc21e7256c96090abed5a512c (patch)
tree7b0d48d59ee474ac1a590352507c7890c16f1e8d /block/mq-deadline.c
parentf924cddebc900f7cb10d5538d69523e558fa681c (diff)
block: remove the bi_phys_segments field in struct bio
We only need the number of segments in the blk-mq submission path. Remove the field from struct bio, and return it from a variant of blk_queue_split instead of that it can passed as an argument to those functions that need the value. This also means we stop recounting segments except for cloning and partial segments. To keep the number of arguments in this how path down remove pointless struct request_queue arguments from any of the functions that had it and grew a nr_segs argument. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/mq-deadline.c')
-rw-r--r--block/mq-deadline.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index 1876f5712bfd..b8a682b5a1bb 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -469,7 +469,8 @@ static int dd_request_merge(struct request_queue *q, struct request **rq,
469 return ELEVATOR_NO_MERGE; 469 return ELEVATOR_NO_MERGE;
470} 470}
471 471
472static bool dd_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio) 472static bool dd_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio,
473 unsigned int nr_segs)
473{ 474{
474 struct request_queue *q = hctx->queue; 475 struct request_queue *q = hctx->queue;
475 struct deadline_data *dd = q->elevator->elevator_data; 476 struct deadline_data *dd = q->elevator->elevator_data;
@@ -477,7 +478,7 @@ static bool dd_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio)
477 bool ret; 478 bool ret;
478 479
479 spin_lock(&dd->lock); 480 spin_lock(&dd->lock);
480 ret = blk_mq_sched_try_merge(q, bio, &free); 481 ret = blk_mq_sched_try_merge(q, bio, nr_segs, &free);
481 spin_unlock(&dd->lock); 482 spin_unlock(&dd->lock);
482 483
483 if (free) 484 if (free)