Re: [PATCH 2/5] blk-mq: rename hctx_lock & hctx_unlock

Christoph Hellwig
2021-11-22T09:00:39Z

On Fri, Nov 19, 2021 at 10:18:46AM +0800, Ming Lei wrote:
> +static inline void queue_unlock(struct request_queue *q, bool blocking,
> + int srcu_idx)

I don't think this is a good name, as it can be easily confused with
q->queue_lock.

> + __releases(q->srcu)
> {
> - if (!(hctx->flags & BLK_MQ_F_BLOCKING))
> + if (!blocking)
> rcu_read_unlock();
> else
> - srcu_read_unlock(hctx->queue->srcu, srcu_idx);
> + srcu_read_unlock(q->srcu, srcu_idx);
> }

I think you want to make BLK_MQ_F_BLOCKING accessible from the
request_queue instead of passing the extra argument as well.