diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-10-20 20:00:49 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-21 08:27:17 -0600 |
commit | 179ae84f7ef5225e03cd29cb9a75f6e90d2d7388 (patch) | |
tree | dc6205b3b64bdd5c8a49ea2b2978809d80c68462 /block/blk-mq-sched.h | |
parent | 6450fe1f668f410fe2ab69c79a52a0929a4a8296 (diff) | |
download | linux-179ae84f7ef5225e03cd29cb9a75f6e90d2d7388.tar.bz2 |
block: clean up blk_mq_submit_bio() merging
Combine blk_mq_sched_bio_merge() and blk_attempt_plug_merge() under a
common if, so we don't check it twice.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/daedc90d4029a5d1d73344771632b1faca3aaf81.1634755800.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-sched.h')
-rw-r--r-- | block/blk-mq-sched.h | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index 98836106b25f..25d1034952b6 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h @@ -12,7 +12,7 @@ void blk_mq_sched_assign_ioc(struct request *rq); bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio, unsigned int nr_segs, struct request **merged_request); -bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, +bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, unsigned int nr_segs); bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq, struct list_head *free); @@ -43,16 +43,6 @@ static inline bool bio_mergeable(struct bio *bio) } static inline bool -blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, - unsigned int nr_segs) -{ - if (blk_queue_nomerges(q) || !bio_mergeable(bio)) - return false; - - return __blk_mq_sched_bio_merge(q, bio, nr_segs); -} - -static inline bool blk_mq_sched_allow_merge(struct request_queue *q, struct request *rq, struct bio *bio) { |