Make the position an in/out argument like all the other read/write helpers and and make the buf argument a void pointer.
Showing the changes to kernel/sysctl_binary.c (1 of 9 files). Show all
Unified · Split
| @@ -1017,6 +1017,7 @@ static ssize_t bin_intvec(struct file *file, · 1016 unmodified lines | ||
| 1017 | 1017 | size_t length = newlen / sizeof(*vec); |
| 1018 | 1018 | char *str, *end; |
| 1019 | 1019 | int i; |
| 1020 | + loff_t pos = 0; | |
| 1020 | 1021 | |
| 1021 | 1022 | str = buffer; |
| 1022 | 1023 | end = str + BUFSZ; |
| @@ -1030,7 +1031,7 @@ static ssize_t bin_intvec(struct file *file, · 7 unmodified lines | ||
| 1030 | 1031 | str += scnprintf(str, end - str, "%lu\t", value); |
| 1031 | 1032 | } |
| 1032 | 1033 | |
| 1033 | − result = kernel_write(file, buffer, str - buffer, 0); | |
| 1034 | + result = kernel_write(file, buffer, str - buffer, &pos); | |
| 1034 | 1035 | if (result < 0) |
| 1035 | 1036 | goto out_kfree; |
| 1036 | 1037 | } |
| @@ -1089,6 +1090,7 @@ static ssize_t bin_ulongvec(struct file *file, · 52 unmodified lines | ||
| 1089 | 1090 | size_t length = newlen / sizeof(*vec); |
| 1090 | 1091 | char *str, *end; |
| 1091 | 1092 | int i; |
| 1093 | + loff_t pos = 0; | |
| 1092 | 1094 | |
| 1093 | 1095 | str = buffer; |
| 1094 | 1096 | end = str + BUFSZ; |
| @@ -1102,7 +1104,7 @@ static ssize_t bin_ulongvec(struct file *file, · 7 unmodified lines | ||
| 1102 | 1104 | str += scnprintf(str, end - str, "%lu\t", value); |
| 1103 | 1105 | } |
| 1104 | 1106 | |
| 1105 | − result = kernel_write(file, buffer, str - buffer, 0); | |
| 1107 | + result = kernel_write(file, buffer, str - buffer, &pos); | |
| 1106 | 1108 | if (result < 0) |
| 1107 | 1109 | goto out_kfree; |
| 1108 | 1110 | } |
| @@ -1192,6 +1194,7 @@ static ssize_t bin_dn_node_address(struct file *file, · 83 unmodified lines | ||
| 1192 | 1194 | __le16 dnaddr; |
| 1193 | 1195 | char buf[15]; |
| 1194 | 1196 | int len; |
| 1197 | + loff_t pos = 0; | |
| 1195 | 1198 | |
| 1196 | 1199 | result = -EINVAL; |
| 1197 | 1200 | if (newlen != sizeof(dnaddr)) |
| @@ -1205,7 +1208,7 @@ static ssize_t bin_dn_node_address(struct file *file, · 7 unmodified lines | ||
| 1205 | 1208 | le16_to_cpu(dnaddr) >> 10, |
| 1206 | 1209 | le16_to_cpu(dnaddr) & 0x3ff); |
| 1207 | 1210 | |
| 1208 | − result = kernel_write(file, buf, len, 0); | |
| 1211 | + result = kernel_write(file, buf, len, &pos); | |
| 1209 | 1212 | if (result < 0) |
| 1210 | 1213 | goto out; |
| 1211 | 1214 | } |