From 3bb225d66be633c88ba01c6e7a0cebf91837cd13 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 21 Apr 2010 10:31:16 +0200 Subject: [PATCH] Revert "fsync always now uses O_DIRECT on Linux" This reverts commit 566c3c7a22c0ec217c40f7a95db2bb83c8cc16c7. --- config.h | 5 ----- redis.c | 11 +---------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/config.h b/config.h index d1da9887d..754d3aa86 100644 --- a/config.h +++ b/config.h @@ -35,9 +35,4 @@ #define HAVE_KQUEUE 1 #endif -/* test for O_DIRECT */ -#ifdef __linux__ -#define HAVE_O_DIRECT 1 -#endif - #endif diff --git a/redis.c b/redis.c index de4f5763d..53d5c215c 100644 --- a/redis.c +++ b/redis.c @@ -1673,16 +1673,7 @@ static void initServer() { acceptHandler, NULL) == AE_ERR) oom("creating file event"); if (server.appendonly) { - int flags = O_WRONLY|O_APPEND|O_CREAT; - -#ifdef HAVE_O_DIRECT - if (server.appendfsync == APPENDFSYNC_ALWAYS) { - flags |= O_DIRECT; - server.appendfsync = APPENDFSYNC_NO; - } -#endif - - server.appendfd = open(server.appendfilename,flags,0644); + server.appendfd = open(server.appendfilename,O_WRONLY|O_APPEND|O_CREAT,0644); if (server.appendfd == -1) { redisLog(REDIS_WARNING, "Can't open the append-only file: %s", strerror(errno)); -- GitLab