diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-10-13 12:43:41 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-18 06:17:36 -0600 |
commit | abd45c159df5fcb7ac820e2825dac85de7c01c21 (patch) | |
tree | 8ab589415f5cc81205263a0813109deee6ffc067 /block/blk-mq.c | |
parent | 09ce8744253a038eb658c14f9dc3b77fa021fc9f (diff) | |
download | lwn-abd45c159df5fcb7ac820e2825dac85de7c01c21.tar.gz lwn-abd45c159df5fcb7ac820e2825dac85de7c01c21.zip |
block: handle fast path of bio splitting inline
The fast path is no splitting needed. Separate the handling into a
check part we can inline, and an out-of-line handling path if we do
need to split.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 0860f622099f..09219080855f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2259,11 +2259,12 @@ void blk_mq_submit_bio(struct bio *bio) struct request *rq; struct blk_plug *plug; struct request *same_queue_rq = NULL; - unsigned int nr_segs; + unsigned int nr_segs = 1; blk_status_t ret; blk_queue_bounce(q, &bio); - __blk_queue_split(&bio, &nr_segs); + if (blk_may_split(q, bio)) + __blk_queue_split(q, &bio, &nr_segs); if (!bio_integrity_prep(bio)) goto queue_exit; |