From 97c8d7a3580ff331973fb2ed98d8b9b9a21f0b5f Mon Sep 17 00:00:00 2001 From: nick Date: Mon, 24 Feb 2014 13:47:29 +0000 Subject: [PATCH] Remove a compile-time optional selection of O_DIRECT (was never used) The mmap() manpage tells us to avoid using O_DIRECT with mmap() - so do so. --- src/common/ioutil.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/common/ioutil.c b/src/common/ioutil.c index 262fc07..b63f2a0 100644 --- a/src/common/ioutil.c +++ b/src/common/ioutil.c @@ -80,13 +80,8 @@ int open_and_mmap(const char* filename, int* out_fd, off64_t *out_size, void **o { off64_t size; - /* O_DIRECT seems to be intermittently supported. Leaving it as - * a compile-time option for now. */ -#ifdef DIRECT_IO - *out_fd = open(filename, O_RDWR | O_DIRECT | O_SYNC ); -#else + /* O_DIRECT should not be used with mmap() */ *out_fd = open(filename, O_RDWR | O_SYNC ); -#endif if (*out_fd < 1) { warn("open(%s) failed: does it exist?", filename);