History

fs: fix kernel_write prototype

Make the position an in/out argument like all the other read/write helpers and and make the buf argument a void pointer.

Christoph Hellwig committed 9 years ago

Commit e13ec931 parent bdd1d2d9 files · +19 −13Browse files

Showing the changes to kernel/sysctl_binary.c (1 of 9 files). Show all

Unified · Split

kernel/sysctl_binary.c+6−3
@@ -1017,6 +1017,7 @@ static ssize_t bin_intvec(struct file *file, · 1016 unmodified lines
1017 size_t length = newlen / sizeof(*vec);1017 size_t length = newlen / sizeof(*vec);
1018 char *str, *end;1018 char *str, *end;
1019 int i;1019 int i;
1020 loff_t pos = 0;
1020 1021
1021 str = buffer;1022 str = buffer;
1022 end = str + BUFSZ;1023 end = str + BUFSZ;
@@ -1030,7 +1031,7 @@ static ssize_t bin_intvec(struct file *file, · 7 unmodified lines
1030 str += scnprintf(str, end - str, "%lu\t", value);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 if (result < 0)1035 if (result < 0)
1035 goto out_kfree;1036 goto out_kfree;
1036 }1037 }
@@ -1089,6 +1090,7 @@ static ssize_t bin_ulongvec(struct file *file, · 52 unmodified lines
1089 size_t length = newlen / sizeof(*vec);1090 size_t length = newlen / sizeof(*vec);
1090 char *str, *end;1091 char *str, *end;
1091 int i;1092 int i;
1093 loff_t pos = 0;
1092 1094
1093 str = buffer;1095 str = buffer;
1094 end = str + BUFSZ;1096 end = str + BUFSZ;
@@ -1102,7 +1104,7 @@ static ssize_t bin_ulongvec(struct file *file, · 7 unmodified lines
1102 str += scnprintf(str, end - str, "%lu\t", value);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 if (result < 0)1108 if (result < 0)
1107 goto out_kfree;1109 goto out_kfree;
1108 }1110 }
@@ -1192,6 +1194,7 @@ static ssize_t bin_dn_node_address(struct file *file, · 83 unmodified lines
1192 __le16 dnaddr;1194 __le16 dnaddr;
1193 char buf[15];1195 char buf[15];
1194 int len;1196 int len;
1197 loff_t pos = 0;
1195 1198
1196 result = -EINVAL;1199 result = -EINVAL;
1197 if (newlen != sizeof(dnaddr))1200 if (newlen != sizeof(dnaddr))
@@ -1205,7 +1208,7 @@ static ssize_t bin_dn_node_address(struct file *file, · 7 unmodified lines
1205 le16_to_cpu(dnaddr) >> 10,1208 le16_to_cpu(dnaddr) >> 10,
1206 le16_to_cpu(dnaddr) & 0x3ff);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 if (result < 0)1212 if (result < 0)
1210 goto out;1213 goto out;
1211 }1214 }