f2fs: convert to use sysfs_emit
PATCH 1/1 f2fs: convert to use sysfs_emit
Let's use sysfs_emit.
Signed-off-by Yangtao Li <[email protected]>
--- fs/f2fs/sysfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
fs/f2fs/sysfs.c +2 -8
@@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,if (!strcmp (a->attr.name,"ckpt_thread_ioprio" )) {struct ckpt_req_control *cprc = &sbi->cprc_info; -int len =0 ;int class =IOPRIO_PRIO_CLASS (cprc->ckpt_thread_ioprio);int data =IOPRIO_PRIO_DATA (cprc->ckpt_thread_ioprio); -if (class ==IOPRIO_CLASS_RT ) - len +=scnprintf (buf + len,PAGE_SIZE - len,"rt," ); -else if (class ==IOPRIO_CLASS_BE ) - len +=scnprintf (buf + len,PAGE_SIZE - len,"be," ); -else +if (class !=IOPRIO_CLASS_RT && class !=IOPRIO_CLASS_BE )return -EINVAL ; - len +=scnprintf (buf + len,PAGE_SIZE - len,"%d\n" , data); -return len; +return sysfs_emit (buf,"%s,%d\n" , class ==IOPRIO_CLASS_RT ?"rt" :"be" , data); }#ifdef CONFIG_F2FS_FS_COMPRESSION
Signature · 8 lines
2.35.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerQuoted 20 lines · Yangtao Li
Let's use
sysfs_emit.Signed-off-by Yangtao Li <[email protected]>--- fs/f2fs/sysfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)fs/f2fs/sysfs.c +0
-2@@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,if (!strcmp (a->attr.name,"ckpt_thread_ioprio" )) {struct ckpt_req_control *cprc = &sbi->cprc_info; -int len =0 ;int class =IOPRIO_PRIO_CLASS (cprc->ckpt_thread_ioprio);int data =IOPRIO_PRIO_DATA (cprc->ckpt_thread_ioprio); -if (class ==IOPRIO_CLASS_RT )
fs/f2fs/sysfs.c static ssize_t f2fs_sbi_show(struct f2fs_attr *a, · line 321
Quoted 10 lines
fs/f2fs/sysfs.c +2
-6- len +=scnprintf (buf + len,PAGE_SIZE - len,"rt," ); - else if (class == IOPRIO_CLASS_BE) - len += scnprintf(buf + len, PAGE_SIZE - len, "be,"); - else +if (class !=IOPRIO_CLASS_RT && class !=IOPRIO_CLASS_BE )return -EINVAL ; - len += scnprintf(buf + len, PAGE_SIZE - len, "%d\n", data); - return len; +return sysfs_emit (buf,"%s,%d\n" , class ==IOPRIO_CLASS_RT ?"rt" :"be" , data);
Exceed 80 columns.
Thanks,
Quoted 3 lines
fs/f2fs/sysfs.c +0
-0}#ifdef CONFIG_F2FS_FS_COMPRESSION
Jaegeuk Kim
maintainerQuoted 22 lines · Chao Yu
Quoted 21 lines · Yangtao Li
Let's use
sysfs_emit.Signed-off-by Yangtao Li <[email protected]>--- fs/f2fs/sysfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)fs/f2fs/sysfs.c +0
-5@@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,if (!strcmp (a->attr.name,"ckpt_thread_ioprio" )) {struct ckpt_req_control *cprc = &sbi->cprc_info; -int len =0 ;int class =IOPRIO_PRIO_CLASS (cprc->ckpt_thread_ioprio);int data =IOPRIO_PRIO_DATA (cprc->ckpt_thread_ioprio); -if (class ==IOPRIO_CLASS_RT ) - len +=scnprintf (buf + len,PAGE_SIZE - len,"rt," ); -else if (class ==IOPRIO_CLASS_BE ) - len +=scnprintf (buf + len,PAGE_SIZE - len,"be," );
Quoted 8 lines
fs/f2fs/sysfs.c static ssize_t f2fs_sbi_show(struct f2fs_attr *a, · line 321
Quoted 6 lines
fs/f2fs/sysfs.c +2
-3-else +if (class !=IOPRIO_CLASS_RT && class !=IOPRIO_CLASS_BE )return -EINVAL ; - len +=scnprintf (buf + len,PAGE_SIZE - len,"%d\n" , data); -return len; +return sysfs_emit (buf,"%s,%d\n" , class ==IOPRIO_CLASS_RT ?"rt" :"be" , data);Exceed 80 columns.
Fixed and applied.
Quoted 5 lines
Thanks,
Quoted 2 lines
fs/f2fs/sysfs.c +0
-0}#ifdef CONFIG_F2FS_FS_COMPRESSION
Quoted 32 lines · Jaegeuk Kim
Quoted 22 lines · Chao Yu
Quoted 21 lines · Yangtao Li
Let's use
sysfs_emit.Signed-off-by Yangtao Li <[email protected]>--- fs/f2fs/sysfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)fs/f2fs/sysfs.c +0
-5@@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,if (!strcmp (a->attr.name,"ckpt_thread_ioprio" )) {struct ckpt_req_control *cprc = &sbi->cprc_info; -int len =0 ;int class =IOPRIO_PRIO_CLASS (cprc->ckpt_thread_ioprio);int data =IOPRIO_PRIO_DATA (cprc->ckpt_thread_ioprio); -if (class ==IOPRIO_CLASS_RT ) - len +=scnprintf (buf + len,PAGE_SIZE - len,"rt," ); -else if (class ==IOPRIO_CLASS_BE ) - len +=scnprintf (buf + len,PAGE_SIZE - len,"be," );Quoted 8 lines
fs/f2fs/sysfs.c static ssize_t f2fs_sbi_show(struct f2fs_attr *a, · line 321
Quoted 6 lines
fs/f2fs/sysfs.c +2
-3-else +if (class !=IOPRIO_CLASS_RT && class !=IOPRIO_CLASS_BE )return -EINVAL ; - len +=scnprintf (buf + len,PAGE_SIZE - len,"%d\n" , data); -return len; +return sysfs_emit (buf,"%s,%d\n" , class ==IOPRIO_CLASS_RT ?"rt" :"be" , data);Exceed 80 columns.
Quoted 1 line
Fixed and applied.
Reviewed-by Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel