Skip to content

Commit 467761f

Browse files
committed
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: Johannes Thumshirn <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 5a75034 commit 467761f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/btrfs/sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,16 +1160,16 @@ static ssize_t btrfs_read_policy_show(struct kobject *kobj,
11601160

11611161
for (i = 0; i < BTRFS_NR_READ_POLICY; i++) {
11621162
if (fs_devices->read_policy == i)
1163-
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s[%s]",
1163+
ret += sysfs_emit_at(buf, ret, "%s[%s]",
11641164
(ret == 0 ? "" : " "),
11651165
btrfs_read_policy_name[i]);
11661166
else
1167-
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
1167+
ret += sysfs_emit_at(buf, ret, "%s%s",
11681168
(ret == 0 ? "" : " "),
11691169
btrfs_read_policy_name[i]);
11701170
}
11711171

1172-
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n");
1172+
ret += sysfs_emit_at(buf, ret, "\n");
11731173

11741174
return ret;
11751175
}

0 commit comments

Comments
 (0)