forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2d46a57
committed
Improve copydir() code for the case that fsync is off.
We should avoid calling sync_file_range or posix_fadvise in this case,since (a) we don't really care if the data gets synced, and might aswell save the kernel calls; (b) at least on Linux we know that thekernel might block us until it's scheduled the write.Also, avoid making a useless second traversal of the directory treeif we're not actually going to call fsync(2) after all.1 parent2c4f5b4 commit2d46a57
2 files changed
+15
-7
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| 101 | + | |
101 | 102 |
| |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 |
| |
103 | 107 |
| |
104 | 108 |
| |
| |||
200 | 204 |
| |
201 | 205 |
| |
202 | 206 |
| |
203 |
| - | |
| 207 | + | |
204 | 208 |
| |
205 |
| - | |
| 209 | + | |
206 | 210 |
| |
207 | 211 |
| |
208 | 212 |
| |
|
Lines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
340 |
| - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
341 | 343 |
| |
342 | 344 |
| |
343 | 345 |
| |
344 | 346 |
| |
| 347 | + | |
| 348 | + | |
345 | 349 |
| |
346 |
| - | |
| 350 | + | |
347 | 351 |
| |
348 |
| - | |
349 |
| - | |
350 |
| - | |
| 352 | + | |
351 | 353 |
| |
| 354 | + | |
| 355 | + | |
352 | 356 |
| |
353 | 357 |
| |
354 | 358 |
| |
|
0 commit comments
Comments
(0)