Merge tag 'phy-for-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
[linux-block.git] / block / blk-mq.h
index 0b2870839cdd6c827fd35ce51a9c9cf232a72c38..ef59fee62780d301d4756000e660464078a6eaa2 100644 (file)
@@ -377,17 +377,17 @@ 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(q, check_sleep, dispatch_ops)        \
 do {                                                           \
-       if (!blk_queue_has_srcu(q)) {                           \
-               rcu_read_lock();                                \
-               (dispatch_ops);                                 \
-               rcu_read_unlock();                              \
-       } else {                                                \
+       if ((q)->tag_set->flags & BLK_MQ_F_BLOCKING) {          \
                int srcu_idx;                                   \
                                                                \
                might_sleep_if(check_sleep);                    \
-               srcu_idx = srcu_read_lock((q)->srcu);           \
+               srcu_idx = srcu_read_lock((q)->tag_set->srcu);  \
                (dispatch_ops);                                 \
-               srcu_read_unlock((q)->srcu, srcu_idx);          \
+               srcu_read_unlock((q)->tag_set->srcu, srcu_idx); \
+       } else {                                                \
+               rcu_read_lock();                                \
+               (dispatch_ops);                                 \
+               rcu_read_unlock();                              \
        }                                                       \
 } while (0)