f2fs: make gc_idle sysfs node readable
PATCH 1/1 f2fs: make gc_idle sysfs node readable
Changed a way of showing values of them to use strings.
--- fs/f2fs/sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/f2fs/sysfs.c +4 -0
@@ -332,6 +332,10 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,return sysfs_emit (buf,"%u\n" , sbi->compr_new_inode);#endif +if (!strcmp (a->attr.name,"gc_idle" )) +return sysfs_emit (buf,"%s\n" , + gc_mode_names[sbi->gc_mode]); +if (!strcmp (a->attr.name,"gc_urgent" ))return sysfs_emit (buf,"%s\n" , gc_mode_names[sbi->gc_mode]);
Signature · 1 line
2.25.1
Chao Yu
maintainerQuoted 1 line · Yangtao Li
Changed a way of showing values of them to use strings.
This change breaks forward compatibility of gc_idle interface.
Thanks,
Quoted 21 lines
Signed-off-by Yangtao Li <[email protected]>--- fs/f2fs/sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)fs/f2fs/sysfs.c +4
-0@@ -332,6 +332,10 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,return sysfs_emit (buf,"%u\n" , sbi->compr_new_inode);#endif +if (!strcmp (a->attr.name,"gc_idle" )) +return sysfs_emit (buf,"%s\n" , + gc_mode_names[sbi->gc_mode]); +if (!strcmp (a->attr.name,"gc_urgent" ))return sysfs_emit (buf,"%s\n" , gc_mode_names[sbi->gc_mode]);
Hi Chao,
What: /sys/fs/f2fs/<disk>/gc_idle Date: July 2013 Contact: "Namjae Jeon" <[email protected]> Description: Controls the victim selection policy for garbage collection.
Setting gc_idle = 0(default) will disable this option. Setting:
=========== =============================================== gc_idle = 1 will select the Cost Benefit approach & setting gc_idle = 2 will select the greedy approach & setting gc_idle = 3 will select the age-threshold based approach. =========== ===============================================
From the kernel documentation, this node only describes the writing of the value, and does not describe the reading of the value.
Actually, this modification does the same thing as commit e60aeb2dee1a ("f2fs: make gc_urgent and gc_segment_mode sysfs node readabl"). I understand it is an addition to the omission of the patch above.
Why gc_urgent and gc_segment_mode can be modified to string, but gc_idle breaks forward compatibility?
Thanks,
Chao Yu
maintainerQuoted 8 lines · Yangtao Li
Hi Chao,
What: /sys/fs/f2fs/<disk>/gc_idle Date: July 2013 Contact: "Namjae Jeon" <[email protected]> Description: Controls the victim selection policy for garbage collection.Setting
gc_idle= 0(default) will disable this option. Setting:
Quoted 8 lines
=========== ===============================================
gc_idle= 1 will select the Cost Benefit approach & settinggc_idle= 2 will select the greedy approach & settinggc_idle= 3 will select the age-threshold based approach. =========== ===============================================From the kernel documentation, this node only describes the writing of
the value, and does not describe the reading of the value.
If the value is used by userspace program, after the change, it will break
userspace.
Quoted 7 lines
Actually, this modification does the same thing as commit
e60aeb2dee1a("f2fs: makegc_urgentandgc_segment_modesysfs node readabl"). I understand it is an addition to the omission of the patch above.Why
gc_urgentandgc_segment_modecan be modified to string, butgc_idlebreaks forward compatibility?
Oops, I guess that patch may have caused a regression...if there is any user..
Quoted 2 lines
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel