summaryrefslogtreecommitdiff
path: root/rust/helpers/rbtree.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2025-04-15 13:51:34 -0700
committerJens Axboe <axboe@kernel.dk>2025-04-21 05:07:02 -0600
commite093b784ab98ce5aff4cd81b1072987131facfba (patch)
treed94c49eafcb04ef90e86e8142700ed9baef8bc94 /rust/helpers/rbtree.c
parent9d7a0577c9db35c4cc52db90bc415ea248446472 (diff)
block: Simplify blk_mq_dispatch_rq_list() and its callers
The 'nr_budgets' argument of blk_mq_dispatch_rq_list() is either the number of elements in the 'list' argument or zero. Instead of passing the number of list elements to blk_mq_dispatch_rq_list(), pass a boolean argument that indicates whether or not blk_mq_dispatch_rq_list() should request the block driver for a budget for each request in 'list'. Remove the code for counting list elements from blk_mq_dispatch_rq_list() callers where possible. Remove the code that decrements nr_budgets from blk_mq_dispatch_rq_list() because it is superfluous. Each request that is processed by blk_mq_dispatch_rq_list() is in one of these two states if 'get_budget' is false: * Either the request is on 'list' and the budget for the request has to be released from the error path. * Or the request is not on 'list' and q->mq_ops->queue_rq() has already released the budget (ret != BLK_STS_OK) or q->mq_ops->queue_rq() will release the budget asynchronously (ret == BLK_STS_OK). Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: John Garry <john.g.garry@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20250415205134.3650042-1-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'rust/helpers/rbtree.c')
0 files changed, 0 insertions, 0 deletions