[PATCH 2/2] NVMe: Remove hctx reliance for multi-namespace
Keith Busch
keith.busch at intel.com
Fri May 29 10:58:37 PDT 2015
On Fri, 29 May 2015, Christoph Hellwig wrote:
>> +static void nvme_exit_tags(void *data, unsigned int hctx_idx)
>> {
>> + struct nvme_dev *dev = data;
>> + struct nvme_queue *nvmeq = dev->queues[
>> + (hctx_idx % dev->queue_count) + 1];
>> + nvmeq->tags = NULL;
>> +}
>>
>> +static int nvme_init_tags(struct blk_mq_tags *tags, void *data,
>> + unsigned int hctx_idx)
>> +{
>> + struct nvme_dev *dev = data;
>> + struct nvme_queue *nvmeq = dev->queues[
>> + (hctx_idx % dev->queue_count) + 1];
>> + WARN_ON(nvmeq->tags);
>> + nvmeq->tags = tags;
>> + return 0;
>
> I'd rather do the runtime indexing with the qid into the tags array than
> adding these methods. I also don't see why you need the modulo
> arithmetic.
Good call. I copied the modulo from existing functions, but that's
useless since hctx_idx is never > queue_count.
Only now do I see I can get the tags with
dev->tagset->tags[nvmeq->qid - 1]
This will simplify a lot of things...
> Otherwise the series looks nice to me.
More information about the Linux-nvme
mailing list