Commit 467761f9 authored by David Sterba's avatar David Sterba

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.
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 5a75034e
...@@ -1160,16 +1160,16 @@ static ssize_t btrfs_read_policy_show(struct kobject *kobj, ...@@ -1160,16 +1160,16 @@ static ssize_t btrfs_read_policy_show(struct kobject *kobj,
for (i = 0; i < BTRFS_NR_READ_POLICY; i++) { for (i = 0; i < BTRFS_NR_READ_POLICY; i++) {
if (fs_devices->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 ? "" : " "), (ret == 0 ? "" : " "),
btrfs_read_policy_name[i]); btrfs_read_policy_name[i]);
else else
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s", ret += sysfs_emit_at(buf, ret, "%s%s",
(ret == 0 ? "" : " "), (ret == 0 ? "" : " "),
btrfs_read_policy_name[i]); btrfs_read_policy_name[i]);
} }
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n"); ret += sysfs_emit_at(buf, ret, "\n");
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment