aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-03-19 17:25:02 -0400
committerJens Axboe <axboe@fb.com>2014-03-19 17:25:02 -0400
commit5d12f905cc50c0810628d0deedd478ec2db48659 (patch)
treed1cb703151748740c5fb550630710a4f253a7e49 /block/blk-mq.c
parent95363efde193079541cb379eb47140e9c4d355d5 (diff)
blk-mq: fix wrong usage of hctx->state vs hctx->flags
BLK_MQ_F_* flags are for hctx->flags, and are non-atomic and set at registration time. BLK_MQ_S_* flags are dynamic and atomic, and are accessed through hctx->state. Some of the BLK_MQ_S_STOPPED uses were wrong. Additionally, the header file should not use a bit shift for the _S_ flags, as they are done through the set/test_bit functions. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 92284af4e0df..ed216f27e3b8 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -547,7 +547,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
547 LIST_HEAD(rq_list); 547 LIST_HEAD(rq_list);
548 int bit, queued; 548 int bit, queued;
549 549
550 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->flags))) 550 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state)))
551 return; 551 return;
552 552
553 hctx->run++; 553 hctx->run++;
@@ -636,7 +636,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
636 636
637void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) 637void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
638{ 638{
639 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->flags))) 639 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state)))
640 return; 640 return;
641 641
642 if (!async) 642 if (!async)
@@ -656,7 +656,7 @@ void blk_mq_run_queues(struct request_queue *q, bool async)
656 queue_for_each_hw_ctx(q, hctx, i) { 656 queue_for_each_hw_ctx(q, hctx, i) {
657 if ((!blk_mq_hctx_has_pending(hctx) && 657 if ((!blk_mq_hctx_has_pending(hctx) &&
658 list_empty_careful(&hctx->dispatch)) || 658 list_empty_careful(&hctx->dispatch)) ||
659 test_bit(BLK_MQ_S_STOPPED, &hctx->flags)) 659 test_bit(BLK_MQ_S_STOPPED, &hctx->state))
660 continue; 660 continue;
661 661
662 blk_mq_run_hw_queue(hctx, async); 662 blk_mq_run_hw_queue(hctx, async);