[PATCH v5 5/6] nvme: add csi, ms and nuse to sysfs
Chaitanya Kulkarni
chaitanyak at nvidia.com
Mon Dec 11 21:41:06 PST 2023
> diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
> index d682d0a667a0..3cfae0c3af76 100644
> --- a/drivers/nvme/host/sysfs.c
> +++ b/drivers/nvme/host/sysfs.c
> @@ -114,12 +114,97 @@ static ssize_t nsid_show(struct device *dev, struct device_attribute *attr,
> }
> static DEVICE_ATTR_RO(nsid);
>
> +static ssize_t csi_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + return sysfs_emit(buf, "%d\n", dev_to_ns_head(dev)->ids.csi);
> +}
> +static DEVICE_ATTR_RO(csi);
> +
> +static ssize_t metadata_bytes_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + return sysfs_emit(buf, "%d\n", dev_to_ns_head(dev)->ms);
> +}
> +static DEVICE_ATTR_RO(metadata_bytes);
> +
>
do we need to change the format specifier ? since csi (u8) and ms (u16)
are not declared as signed integers ...
-ck
More information about the Linux-nvme
mailing list