Improve copydir() code for the case that fsync is off.
Tom Lane <tgl@sss.pgh.pa.us>
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 as well save the kernel calls; (b) at least on Linux we know that the kernel might block us until it's scheduled the write. Also, avoid making a useless second traversal of the directory tree if we're not actually going to call fsync(2) after all.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/file/copydir.c | modified | +6 −2 |
| src/backend/storage/file/fd.c | modified | +9 −5 |