Skip to contentSkip to conversation

zonefs: add support for FS_IOC_GETFSSYSFSPATH

PATCH Superseded Liao Chen 2 participants 4 messages Aug 9, 2024 – Aug 19, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Liao Chen

author
#0 lore raw

PATCH 1/1 zonefs: add support for FS_IOC_GETFSSYSFSPATH

FS_IOC_GETFSSYSFSPATH ioctl expects sysfs sub-path of a filesystem, the format can be "$FSTYP/$SYSFS_IDENTIFIER" under /sys/fs, it can helps to standardizes exporting sysfs datas across filesystems.

This patch wires up FS_IOC_GETFSSYSFSPATH for zonefs, it will output "zonefs/<dev>".

---
 fs/zonefs/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/zonefs/super.c +1 -0
index faf1eb87895d..e180daa39578 100644
@@ -1262,6 +1262,7 @@ static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc)
 	sb->s_maxbytes = 0;
 	sb->s_op = &zonefs_sops;
 	sb->s_time_gran	= 1;
+	super_set_sysfs_name_id(sb);
 
 	/*
 	 * The block size is set to the device zone write granularity to ensure
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 17 lines · Liao Chen

FS_IOC_GETFSSYSFSPATH ioctl expects sysfs sub-path of a filesystem, the format can be "$FSTYP/$SYSFS_IDENTIFIER" under /sys/fs, it can helps to standardizes exporting sysfs datas across filesystems.

This patch wires up FS_IOC_GETFSSYSFSPATH for zonefs, it will output "zonefs/<dev>".

---
 fs/zonefs/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/zonefs/super.c +0 -0
index faf1eb87895d..e180daa39578 100644

fs/zonefs/super.c static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc) · line 1265

Quoted 4 lines
fs/zonefs/super.c +1 -0
@@ -1262,6 +1262,7 @@ static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc)
 	sb->s_maxbytes = 0;
 	sb->s_op = &zonefs_sops;
 	sb->s_time_gran	= 1;
+	super_set_sysfs_name_id(sb);

Can you resend the patch with this call moved to the beginning of zonefs_sysfs_register() in fs/zonefs/sysfs.c ?
Thanks.

Quoted 3 lines
fs/zonefs/super.c +0 -0
 	/*
 	 * The block size is set to the device zone write granularity to ensure
Signature · 2 lines
Damien Le Moal
Western Digital Research
#2 lore raw
In reply to Liao Chen
Quoted 17 lines · Liao Chen

FS_IOC_GETFSSYSFSPATH ioctl expects sysfs sub-path of a filesystem, the format can be "$FSTYP/$SYSFS_IDENTIFIER" under /sys/fs, it can helps to standardizes exporting sysfs datas across filesystems.

This patch wires up FS_IOC_GETFSSYSFSPATH for zonefs, it will output "zonefs/<dev>".

---
  fs/zonefs/super.c | 1 +
  1 file changed, 1 insertion(+)
fs/zonefs/super.c +0 -0
index faf1eb87895d..e180daa39578 100644

fs/zonefs/super.c static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc) · line 1268

Quoted 7 lines
fs/zonefs/super.c +1 -0
@@ -1262,6 +1262,7 @@ static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc)
  	sb->s_maxbytes = 0;
  	sb->s_op = &zonefs_sops;
  	sb->s_time_gran	= 1;
+	super_set_sysfs_name_id(sb);
 
  	/*
  	 * The block size is set to the device zone write granularity to ensure

Gentle ping

Thanks,
Chen

maintainer
#3 lore raw
Quoted 23 lines · liaochen (A)
Quoted 22 lines · Liao Chen

FS_IOC_GETFSSYSFSPATH ioctl expects sysfs sub-path of a filesystem, the format can be "$FSTYP/$SYSFS_IDENTIFIER" under /sys/fs, it can helps to standardizes exporting sysfs datas across filesystems.

This patch wires up FS_IOC_GETFSSYSFSPATH for zonefs, it will output "zonefs/<dev>".

---
  fs/zonefs/super.c | 1 +
  1 file changed, 1 insertion(+)
fs/zonefs/super.c +1 -0
index faf1eb87895d..e180daa39578 100644
@@ -1262,6 +1262,7 @@ static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc)
  	sb->s_maxbytes = 0;
  	sb->s_op = &zonefs_sops;
  	sb->s_time_gran	= 1;
+	super_set_sysfs_name_id(sb);
 
Quoted 3 lines

fs/zonefs/super.c static int zonefs_fill_super(struct super_block *sb, struct fs_context *fc) · line 1268

Quoted 2 lines
fs/zonefs/super.c +0 -0
  	/*
  	 * The block size is set to the device zone write granularity to ensure

Gentle ping

I replied yesterday with a comment. Did you get that email ?

See:
https://lore.kernel.org/linux-fsdevel/[email protected]/

Quoted 3 lines

Thanks,
Chen

Signature · 2 lines
Damien Le Moal
Western Digital Research