nvme-sysfs: add 'lba_shift' ns attribute
PATCH 1/1 nvme-sysfs: add 'lba_shift' ns attribute
This is to reduce the identify commands to get the information.
Signed-off-by Tokunori Ikegami <[email protected]>
--- drivers/nvme/host/sysfs.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/nvme/host/sysfs.c +8 -0
@@ -176,6 +176,13 @@ static ssize_t csi_show(struct device *dev, struct device_attribute *attr, }static DEVICE_ATTR_RO (csi); +static ssize_t lba_shift_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +return sysfs_emit (buf,"%u\n" ,dev_to_ns_head (dev)->lba_shift); +} +static DEVICE_ATTR_RO (lba_shift); +static ssize_t metadata_bytes_show (struct device *dev,struct device_attribute *attr,char *buf) {
@@ -259,6 +266,7 @@ static struct attribute *nvme_ns_attrs[] = { &dev_attr_eui.attr, &dev_attr_csi.attr, &dev_attr_nsid.attr, + &dev_attr_lba_shift.attr, &dev_attr_metadata_bytes.attr, &dev_attr_nuse.attr, &dev_attr_lbaf_index.attr,
Signature · 1 line
2.43.0
Keith Busch
maintainerQuoted 1 line · Tokunori Ikegami
This is to reduce the identify commands to get the information.
This proposed attribute is redundant with the request_queue's already exported "logical_block_size" attribute.
Okay will do consider to use the attribute mentioned. Thank you.
Quoted 4 lines · Keith Busch
Quoted 1 line · Tokunori Ikegami
This is to reduce the identify commands to get the information.
This proposed attribute is redundant with the request_queue's already exported "
logical_block_size" attribute.