* [PATCH] nvme-sysfs: add 'lba_shift' ns attribute
@ 2024-09-22 10:55 Tokunori Ikegami
2024-09-22 15:26 ` Keith Busch
0 siblings, 1 reply; 3+ messages in thread
From: Tokunori Ikegami @ 2024-09-22 10:55 UTC (permalink / raw)
To: linux-nvme; +Cc: Tokunori Ikegami
This is to reduce the identify commands to get the information.
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
---
drivers/nvme/host/sysfs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 945b7fe11373..467049334f23 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -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,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-sysfs: add 'lba_shift' ns attribute
2024-09-22 10:55 [PATCH] nvme-sysfs: add 'lba_shift' ns attribute Tokunori Ikegami
@ 2024-09-22 15:26 ` Keith Busch
2024-09-22 18:39 ` Tokunori Ikegami
0 siblings, 1 reply; 3+ messages in thread
From: Keith Busch @ 2024-09-22 15:26 UTC (permalink / raw)
To: Tokunori Ikegami; +Cc: linux-nvme
On Sun, Sep 22, 2024 at 07:55:42PM +0900, Tokunori Ikegami wrote:
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme-sysfs: add 'lba_shift' ns attribute
2024-09-22 15:26 ` Keith Busch
@ 2024-09-22 18:39 ` Tokunori Ikegami
0 siblings, 0 replies; 3+ messages in thread
From: Tokunori Ikegami @ 2024-09-22 18:39 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-nvme
Okay will do consider to use the attribute mentioned. Thank you.
On 2024/09/23 0:26, Keith Busch wrote:
> On Sun, Sep 22, 2024 at 07:55:42PM +0900, Tokunori Ikegami wrote:
>> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-22 18:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 10:55 [PATCH] nvme-sysfs: add 'lba_shift' ns attribute Tokunori Ikegami
2024-09-22 15:26 ` Keith Busch
2024-09-22 18:39 ` Tokunori Ikegami
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox