summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-01-11 14:57:04 +0100
committerJens Axboe <axboe@kernel.dk>2024-01-12 17:11:34 +0100
commit309ce6741430b5a7b5e85cd1a7569647f8d9dfa6 (patch)
treef6d16d9d30ccf0c32366e460dfb0377c05cda18e /block
parentblock: print symbolic error name instead of error code (diff)
downloadlinux-309ce6741430b5a7b5e85cd1a7569647f8d9dfa6.tar.xz
linux-309ce6741430b5a7b5e85cd1a7569647f8d9dfa6.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index a4c54c5895a1..f57b86d6de6a 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2900,8 +2900,11 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q,
return NULL;
}
-/* return true if this @rq can be used for @bio */
-static bool blk_mq_can_use_cached_rq(struct request *rq, struct blk_plug *plug,
+/*
+ * Check if we can use the passed on request for submitting the passed in bio,
+ * and remove it from the request list if it can be used.
+ */
+static bool blk_mq_use_cached_rq(struct request *rq, struct blk_plug *plug,
struct bio *bio)
{
enum hctx_type type = blk_mq_get_hctx_type(bio->bi_opf);
@@ -2979,7 +2982,7 @@ void blk_mq_submit_bio(struct bio *bio)
return;
if (blk_mq_attempt_bio_merge(q, bio, nr_segs))
return;
- if (blk_mq_can_use_cached_rq(rq, plug, bio))
+ if (blk_mq_use_cached_rq(rq, plug, bio))
goto done;
percpu_ref_get(&q->q_usage_counter);
} else {