]> granicus.if.org Git - postgresql/commit
Improve copydir() code for the case that fsync is off.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 22 Jul 2012 00:10:29 +0000 (20:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 22 Jul 2012 00:10:29 +0000 (20:10 -0400)
commit2d46a57ddcad394e514bbefb193a4a03e766f163
treea6f4cb51623dc770e284d127986bf37f14f5744b
parent2c4f5b4bc5385b37d062451642abd384536eeeb3
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.
src/backend/storage/file/copydir.c
src/backend/storage/file/fd.c