[PATCH 5/9] nvme: split off TLS sysfs attributes into a separate group

Christoph Hellwig hch at lst.de
Tue Jul 23 07:49:05 PDT 2024


On Mon, Jul 22, 2024 at 02:02:22PM +0200, Hannes Reinecke wrote:
> +static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj,
> +		struct attribute *a, int n)
> +{
> +	struct device *dev = container_of(kobj, struct device, kobj);
> +	struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
> +
> +	if (!ctrl->opts || strcmp(ctrl->opts->transport, "tcp"))
> +		return 0;
> +
> +	if (a == &dev_attr_tls_key.attr &&
> +	    !ctrl->opts->tls)

As-is there is only a single attribute and you don't need the check for
the specific attribute.  And the point of making this a separate
group is that we'll want to not have that check in the future as well,
right?

I would have also kinda expected that this attribute group lives in
tcp.c, is there a good reason to keep it in the core code?




More information about the Linux-nvme mailing list