OSDN Git Service

blk-mq: use helper function to test hw stopped
authorYufen Yu <yuyufen@huawei.com>
Fri, 9 Oct 2020 03:26:30 +0000 (23:26 -0400)
committerJens Axboe <axboe@kernel.dk>
Fri, 9 Oct 2020 18:34:06 +0000 (12:34 -0600)
We have introduced helper function blk_mq_hctx_stopped() to test
BLK_MQ_S_STOPPED.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c

index c5fefd3..e11ee80 100644 (file)
@@ -1807,7 +1807,7 @@ static void blk_mq_run_work_fn(struct work_struct *work)
        /*
         * If we are stopped, don't run the queue.
         */
-       if (test_bit(BLK_MQ_S_STOPPED, &hctx->state))
+       if (blk_mq_hctx_stopped(hctx))
                return;
 
        __blk_mq_run_hw_queue(hctx);