blk-mq: use blk_mq_commit_rqs helper in blk_mq_try_issue_list_directly
authorKemeng Shi <shikemeng@huaweicloud.com>
Wed, 18 Jan 2023 09:37:21 +0000 (17:37 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 Feb 2023 16:22:28 +0000 (09:22 -0700)
commit984ce0a7d75b577fd84f2cc7a83e6e2d2503f90e
treeab666c875b013218f674dcd43dd9cd79b2633b3d
parent0d617a83e8d4d3149d76cc074d9779a3b0ee7baf
blk-mq: use blk_mq_commit_rqs helper in blk_mq_try_issue_list_directly

Call blk_mq_commit_rqs instead of access ->commit_rqs directly. As you
can see in comment of blk_mq_commit_rqs, we only need explicitly call
this in two cases:
 -did not queue everything initially scheduled to queue
 -the last attempt to queue a request failed
Both cases can be checked with ret of last request which breaks list
walk. Then we can remove unnecessary error count and unnecessary
commit triggered by error besides cases described above.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c