OSDN Git Service

Merge tag 'irqchip-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm...
[uclinux-h8/linux.git] / block / blk-mq.h
index d0b3dd5..c11353a 100644 (file)
@@ -23,6 +23,7 @@ struct blk_mq_ctx {
 
        unsigned int            cpu;
        unsigned short          index_hw[HCTX_MAX_TYPES];
+       struct blk_mq_hw_ctx    *hctxs[HCTX_MAX_TYPES];
 
        /* incremented at dispatch time */
        unsigned long           rq_dispatched[2];
@@ -96,26 +97,23 @@ static inline struct blk_mq_hw_ctx *blk_mq_map_queue_type(struct request_queue *
  * blk_mq_map_queue() - map (cmd_flags,type) to hardware queue
  * @q: request queue
  * @flags: request command flags
- * @cpu: CPU
+ * @cpu: cpu ctx
  */
 static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q,
                                                     unsigned int flags,
-                                                    unsigned int cpu)
+                                                    struct blk_mq_ctx *ctx)
 {
        enum hctx_type type = HCTX_TYPE_DEFAULT;
 
-       if ((flags & REQ_HIPRI) &&
-           q->tag_set->nr_maps > HCTX_TYPE_POLL && 
-           q->tag_set->map[HCTX_TYPE_POLL].nr_queues &&
-           test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+       /*
+        * The caller ensure that if REQ_HIPRI, poll must be enabled.
+        */
+       if (flags & REQ_HIPRI)
                type = HCTX_TYPE_POLL;
-
-       else if (((flags & REQ_OP_MASK) == REQ_OP_READ) &&
-                q->tag_set->nr_maps > HCTX_TYPE_READ &&
-                q->tag_set->map[HCTX_TYPE_READ].nr_queues)
+       else if ((flags & REQ_OP_MASK) == REQ_OP_READ)
                type = HCTX_TYPE_READ;
        
-       return blk_mq_map_queue_type(q, type, cpu);
+       return ctx->hctxs[type];
 }
 
 /*