On Tue, 15 Apr 2025 13:51:34 -0700, Bart Van Assche wrote: > 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). > > [...] Applied, thanks! [1/1] block: Simplify blk_mq_dispatch_rq_list() and its callers commit: 6b702ed0630eb5f67e4284a72ad4812989feee1d Best regards, -- Jens Axboe