summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huaweicloud.com>2023-01-18 17:37:17 +0800
committerJens Axboe <axboe@kernel.dk>2023-02-06 09:22:28 -0700
commit08e3599e7401a7eae5e68f5e2601cc4a4e53951b (patch)
tree719fe83bc55c037fe277f6cb6fda6961b9d4d910 /block
parent47df9ce95cd568d3f84218c4f65e9fbd4dfeda55 (diff)
blk-mq: remove unnecessary list_empty check in blk_mq_try_issue_list_directly
We only break the list walk if we get 'BLK_STS_*RESOURCE'. We also count errors for 'BLK_STS_*RESOURCE' error. If list is not empty, errors will always be non-zero. So we can remove unnecessary list_empty check. This will remove redundant list_empty check for case that error happened at sending last request in list. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 3ac732368866..b764bdd6fd81 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2839,8 +2839,7 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
* the driver there was more coming, but that turned out to
* be a lie.
*/
- if ((!list_empty(list) || errors) &&
- hctx->queue->mq_ops->commit_rqs && queued)
+ if (errors && hctx->queue->mq_ops->commit_rqs && queued)
hctx->queue->mq_ops->commit_rqs(hctx);
}