Skip to content

Commit 309ce67

Browse files
Christoph Hellwigaxboe
authored andcommitted
blk-mq: rename blk_mq_can_use_cached_rq
blk_mq_can_use_cached_rq doesn't just check if we can use the request, but also performs the work to actually use it. Remove the _can in the naming, and improve the comment describing the function. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240111135705.2155518-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 25c1772 commit 309ce67

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

block/blk-mq.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,8 +2900,11 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q,
29002900
return NULL;
29012901
}
29022902

2903-
/* return true if this @rq can be used for @bio */
2904-
static bool blk_mq_can_use_cached_rq(struct request *rq, struct blk_plug *plug,
2903+
/*
2904+
* Check if we can use the passed on request for submitting the passed in bio,
2905+
* and remove it from the request list if it can be used.
2906+
*/
2907+
static bool blk_mq_use_cached_rq(struct request *rq, struct blk_plug *plug,
29052908
struct bio *bio)
29062909
{
29072910
enum hctx_type type = blk_mq_get_hctx_type(bio->bi_opf);
@@ -2979,7 +2982,7 @@ void blk_mq_submit_bio(struct bio *bio)
29792982
return;
29802983
if (blk_mq_attempt_bio_merge(q, bio, nr_segs))
29812984
return;
2982-
if (blk_mq_can_use_cached_rq(rq, plug, bio))
2985+
if (blk_mq_use_cached_rq(rq, plug, bio))
29832986
goto done;
29842987
percpu_ref_get(&q->q_usage_counter);
29852988
} else {

0 commit comments

Comments
 (0)