btrfs: sysfs: convert remaining scnprintf to sysfs_emit
David Sterba
maintainerPATCH 1/1 btrfs: sysfs: convert remaining scnprintf to sysfs_emit
The sysfs_emit is the safe API for writing to the sysfs files, previously converted from scnprintf, there's one left to do in btrfs_read_policy_show.
Signed-off-by David Sterba <[email protected]>
--- fs/btrfs/sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/btrfs/sysfs.c +3 -3
@@ -1160,16 +1160,16 @@ static ssize_t btrfs_read_policy_show(struct kobject *kobj,for (i =0 ; i <BTRFS_NR_READ_POLICY ; i++) {if (fs_devices->read_policy == i) - ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"%s[%s]" , + ret +=sysfs_emit_at (buf, ret,"%s[%s]" , (ret ==0 ?"" :" " ), btrfs_read_policy_name[i]);else - ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"%s%s" , + ret +=sysfs_emit_at (buf, ret,"%s%s" , (ret ==0 ?"" :" " ), btrfs_read_policy_name[i]); } - ret +=scnprintf (buf + ret,PAGE_SIZE - ret,"\n" ); + ret +=sysfs_emit_at (buf, ret,"\n" );return ret; }
Signature · 1 line
2.37.3
Looks good,
Reviewed-by Johannes Thumshirn <[email protected]>
Quoted 5 lines · David Sterba
The
sysfs_emitis the safe API for writing to the sysfs files, previously converted from scnprintf, there's one left to do inbtrfs_read_policy_show.Signed-off-by David Sterba <[email protected]>
Reviewed-by; Josef Bacik <[email protected]>
Thanks,
Josef