On Mon, Dec 03, 2018 at 04:49:56PM -0800, Sagi Grimberg wrote:
>> @@ -103,12 +101,17 @@ static inline struct blk_mq_hw_ctx
>> *blk_mq_map_queue(struct request_queue *q,
>> unsigned int flags,
>> unsigned int cpu)
>> {
>> - int hctx_type = 0;
>> + enum hctx_type type = HCTX_TYPE_DEFAULT;
>> +
>> + if (q->tag_set->nr_maps > HCTX_TYPE_POLL &&
>> + ((flags & REQ_HIPRI) && test_bit(QUEUE_FLAG_POLL, &q->queue_flags)))
>> + type = HCTX_TYPE_POLL;
>> - if (q->mq_ops->rq_flags_to_type)
>> - hctx_type = q->mq_ops->rq_flags_to_type(q, flags);
>> + else if (q->tag_set->nr_maps > HCTX_TYPE_READ &&
>> + ((flags & REQ_OP_MASK) == REQ_OP_READ))
>> + type = HCTX_TYPE_READ;
>
> Nit, there seems to be an extra newline that can be omitted here before
> the else if statement (if I'm reading this correctly)...
Empty lines can always be ommited, but in this case I actually like it
as it seems to help readability..