[PATCH v1 3/3] nvmet: Add port transport state flag

Christoph Hellwig hch at lst.de
Fri Apr 13 10:14:21 PDT 2018


> +{
> +	struct nvmet_port *port = to_nvmet_port(item);
> +
> +	return sprintf(page, "%s\n",
> +		nvmet_is_port_active(port) ? "up" : "down");
> +}
> +
> +CONFIGFS_ATTR_RO(nvmet_, trstate);
> +
>  /*
>   * Namespace structures & file operation functions below
>   */
> @@ -870,6 +880,7 @@ static struct configfs_attribute *nvmet_port_attrs[] = {
>  	&nvmet_attr_addr_traddr,
>  	&nvmet_attr_addr_trsvcid,
>  	&nvmet_attr_addr_trtype,
> +	&nvmet_attr_trstate,

Please don't create attributes without a group ever.  Just create a
different group which isn't serialized, e.g. state as the group name
and then transport as the attribute name inside it, or something similar.



More information about the Linux-nvme mailing list