summaryrefslogtreecommitdiff
path: root/block/blk-mq.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2021-12-03 16:15:33 +0300
committerJens Axboe <axboe@kernel.dk>2021-12-04 00:51:29 +0300
commitbcc330f42f442a98d61f153d16c0b6487461ee81 (patch)
tree33da728b0839442c866d10bea20375615a142521 /block/blk-mq.h
parent704b914f15fb7daaf517e3acc4bed472b50ca19e (diff)
downloadlinux-bcc330f42f442a98d61f153d16c0b6487461ee81.tar.xz
blk-mq: pass request queue to blk_mq_run_dispatch_ops
We have switched to allocate srcu into request queue, so it is fine to pass request queue to blk_mq_run_dispatch_ops(). Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20211203131534.3668411-4-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.h')
-rw-r--r--block/blk-mq.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 792f0b29c6eb..d62004e2d531 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -375,9 +375,9 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,
}
/* run the code block in @dispatch_ops with rcu/srcu read lock held */
-#define blk_mq_run_dispatch_ops(hctx, dispatch_ops) \
+#define blk_mq_run_dispatch_ops(q, dispatch_ops) \
do { \
- if (!((hctx)->flags & BLK_MQ_F_BLOCKING)) { \
+ if (!blk_queue_has_srcu(q)) { \
rcu_read_lock(); \
(dispatch_ops); \
rcu_read_unlock(); \
@@ -385,9 +385,9 @@ do { \
int srcu_idx; \
\
might_sleep(); \
- srcu_idx = srcu_read_lock((hctx)->queue->srcu); \
+ srcu_idx = srcu_read_lock((q)->srcu); \
(dispatch_ops); \
- srcu_read_unlock((hctx)->queue->srcu, srcu_idx); \
+ srcu_read_unlock((q)->srcu, srcu_idx); \
} \
} while (0)