Repository navigation
Commit 8924fef
Al Viro
splice: lift pipe_lock out of splice_to_pipe()
* splice_to_pipe() stops at pipe overflow and does *not* take pipe_lock
* ->splice_read() instances do the same
* vmsplice_to_pipe() and do_splice() (ultimate callers of splice_to_pipe())
arrange for waiting, looping, etc. themselves.
That should make pipe_lock the outermost one.
Unfortunately, existing rules for the amount passed by vmsplice_to_pipe()
and do_splice() are quite ugly _and_ userland code can be easily broken
by changing those. It's not even "no more than the maximal capacity of
this pipe" - it's "once we'd fed pipe->nr_buffers pages into the pipe,
leave instead of waiting".
Considering how poorly these rules are documented, let's try "wait for some
space to appear, unless given SPLICE_F_NONBLOCK, then push into pipe
and if we run into overflow, we are done".
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent db85a9e commit 8924fef
2 files changed
Lines changed: 58 additions & 73 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
1367 | | - | |
1368 | 1367 | | |
1369 | 1368 | | |
1370 | 1369 | | |
| |||
1400 | 1399 | | |
1401 | 1400 | | |
1402 | 1401 | | |
1403 | | - | |
1404 | 1402 | | |
1405 | 1403 | | |
1406 | 1404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
223 | 196 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
228 | 200 | | |
229 | | - | |
230 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
231 | 208 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
237 | 212 | | |
238 | | - | |
239 | | - | |
240 | | - | |
| 213 | + | |
241 | 214 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | 215 | | |
253 | 216 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 217 | + | |
| 218 | + | |
258 | 219 | | |
| 220 | + | |
259 | 221 | | |
260 | 222 | | |
261 | 223 | | |
| |||
1339 | 1301 | | |
1340 | 1302 | | |
1341 | 1303 | | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1342 | 1318 | | |
1343 | 1319 | | |
1344 | 1320 | | |
| |||
1421 | 1397 | | |
1422 | 1398 | | |
1423 | 1399 | | |
1424 | | - | |
1425 | | - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1426 | 1407 | | |
1427 | 1408 | | |
1428 | 1409 | | |
| |||
1546 | 1527 | | |
1547 | 1528 | | |
1548 | 1529 | | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
1557 | 1544 | | |
1558 | 1545 | | |
1559 | 1546 | | |
| |||
0 commit comments