Commit 3207cd8
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".
Change-Id: I700882650893824562bd2cdd3f1b1056fff8d686
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent b289e1c commit 3207cd8
2 files changed
Lines changed: 59 additions & 74 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
1455 | 1454 | | |
1456 | 1455 | | |
1457 | 1456 | | |
| |||
1487 | 1486 | | |
1488 | 1487 | | |
1489 | 1488 | | |
1490 | | - | |
1491 | 1489 | | |
1492 | 1490 | | |
1493 | 1491 | | |
| |||
| 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 | | - | |
223 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
224 | 196 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
229 | 200 | | |
230 | | - | |
231 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
232 | 209 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
238 | 213 | | |
239 | | - | |
240 | | - | |
241 | | - | |
| 214 | + | |
242 | 215 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | 216 | | |
254 | 217 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 218 | + | |
| 219 | + | |
259 | 220 | | |
| 221 | + | |
260 | 222 | | |
261 | 223 | | |
262 | 224 | | |
| |||
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