Open file with O_NOATIME, not O_SYNC

O_SYNC is not necessary as we're not doing direct writes to the file.
O_NOATIME might give some speed boost.
This commit is contained in:
Patrick J Cherry
2018-02-05 16:15:36 +00:00
parent ba59a4c03f
commit d1dc7392c2

View File

@@ -85,7 +85,7 @@ int open_and_mmap(const char* filename, int* out_fd, uint64_t *out_size, void **
off64_t size;
/* O_DIRECT should not be used with mmap() */
*out_fd = open(filename, O_RDWR | O_SYNC );
*out_fd = open(filename, O_RDWR | O_NOATIME );
if (*out_fd < 1) {
warn("open(%s) failed: does it exist?", filename);