summaryrefslogtreecommitdiffstats
path: root/block/bfq-iosched.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/bfq-iosched.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/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index f8d430f88d25..a6bf842cbe16 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2027,7 +2027,8 @@ static void bfq_remove_request(struct request_queue *q,
2027 2027
2028} 2028}
2029 2029
2030static bool bfq_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio) 2030static bool bfq_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio,
2031 unsigned int nr_segs)
2031{ 2032{
2032 struct request_queue *q = hctx->queue; 2033 struct request_queue *q = hctx->queue;
2033 struct bfq_data *bfqd = q->elevator->elevator_data; 2034 struct bfq_data *bfqd = q->elevator->elevator_data;
@@ -2050,7 +2051,7 @@ static bool bfq_bio_merge(struct blk_mq_hw_ctx *hctx, struct bio *bio)
2050 bfqd->bio_bfqq = NULL; 2051 bfqd->bio_bfqq = NULL;
2051 bfqd->bio_bic = bic; 2052 bfqd->bio_bic = bic;
2052 2053
2053 ret = blk_mq_sched_try_merge(q, bio, &free); 2054 ret = blk_mq_sched_try_merge(q, bio, nr_segs, &free);
2054 2055
2055 if (free) 2056 if (free)
2056 blk_mq_free_request(free); 2057 blk_mq_free_request(free);