diff options
author | Liu Song <liusong@linux.alibaba.com> | 2022-06-25 23:15:21 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-06-27 06:29:12 -0600 |
commit | ee78ec1077d37d1a4a0860589a65df8ae6d2255c (patch) | |
tree | 63c069d3020b173b26d3ec70df9dabac0e1c4648 /block/blk-mq-tag.c | |
parent | a78418e6a04c93b9ffd3f0f601c5cb10612acb7f (diff) | |
download | linux-ee78ec1077d37d1a4a0860589a65df8ae6d2255c.tar.bz2 |
blk-mq: blk_mq_tag_busy is no need to return a value
Currently "blk_mq_tag_busy" return value has no effect, so adjust it.
Some code implementations have also been adjusted to enhance
readability.
Signed-off-by: Liu Song <liusong@linux.alibaba.com>
Link: https://lore.kernel.org/r/1656170121-1619-1-git-send-email-liusong@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-tag.c')
-rw-r--r-- | block/blk-mq-tag.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 2dcd738c6952..3cfffef1feb3 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -37,29 +37,25 @@ static void blk_mq_update_wake_batch(struct blk_mq_tags *tags, * to get tag when first time, the other shared-tag users could reserve * budget for it. */ -bool __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) +void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx) { unsigned int users; if (blk_mq_is_shared_tags(hctx->flags)) { struct request_queue *q = hctx->queue; - if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags) || - test_and_set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags)) { - return true; - } + if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags)) + return; + set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags); } else { - if (test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state) || - test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state)) { - return true; - } + if (test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state)) + return; + set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state); } users = atomic_inc_return(&hctx->tags->active_queues); blk_mq_update_wake_batch(hctx->tags, users); - - return true; } /* |