[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <57d23cf3-b408-434c-9a20-dfa4eb309677@suse.de>
Date: Mon, 20 Aug 2018 08:34:29 +0200
From: Hannes Reinecke <hare@...e.de>
To: Bart Van Assche <Bart.VanAssche@....com>, "hch@....de" <hch@....de>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"sagi@...mberg.me" <sagi@...mberg.me>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"hare@...e.com" <hare@...e.com>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"keith.busch@...el.com" <keith.busch@...el.com>
Subject: Re: [PATCH 2/5] nvme: register ns_id attributes as default sysfs
groups
On 08/17/2018 10:04 PM, Bart Van Assche wrote:
> On Fri, 2018-08-17 at 09:00 +0200, hch@....de wrote:
>> On Tue, Aug 14, 2018 at 03:44:57PM +0000, Bart Van Assche wrote:
>>> On Tue, 2018-08-14 at 17:39 +0200, Hannes Reinecke wrote:
>>>> While I have considered having nvme_nvm_register_sysfs() returning a
>>>> pointer I would then have to remove the 'static' declaration from the
>>>> nvm_dev_attr_group_12/20.
>>>> Which I didn't really like, either.
>>>
>>> Hmm ... I don't see why the static declaration would have to be removed from
>>> nvm_dev_attr_group_12/20 if nvme_nvm_register_sysfs() would return a pointer?
>>> Am I perhaps missing something?
>>
>> No, I think that would be the preferable approach IFF patching the global
>> table of groups would be viable. I don't think it is, though - we can
>> have both normal NVMe and LightNVM devices in the same system, so we
>> can't just patch it over.
>>
>> So we'll need three different attribut group arrays:
>>
>> const struct attribute_group *nvme_ns_id_attr_groups[] = {
>> &nvme_ns_id_attr_group,
>> NULL,
>> };
>>
>> const struct attribute_group *lightnvm12_ns_id_attr_groups[] = {
>> &nvme_ns_id_attr_group,
>> &nvm_dev_attr_group_12,
>> NULL,
>> };
>>
>> const struct attribute_group *lightnvm20_ns_id_attr_groups[] = {
>> &nvme_ns_id_attr_group,
>> &nvm_dev_attr_group_20,
>> NULL,
>> };
>>
>> and a function to select which one to use.
>
> Hello Christoph,
>
> How about applying the patch below on top of Hannes' patch? The patch below
> has the advantage that it completely separates the open channel sysfs
> attributes from the NVMe core sysfs attributes - the open channel code
> doesn't have to know anything about the NVMe core sysfs attributes and the
> NVMe core does not have to know anything about the open channel sysfs
> attributes.
>
Yes, this looks like the best approach.
I'll fold it into my patchset.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@...e.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
Powered by blists - more mailing lists