[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1307690130-12227-1-git-send-email-adilger@whamcloud.com>
Date: Fri, 10 Jun 2011 01:15:30 -0600
From: Andreas Dilger <adilger@...mcloud.com>
To: tytso@....edu, linux-ext4@...r.kernel.org
Cc: Andreas Dilger <adilger@...mcloud.com>
Subject: [PATCH] ext2fs: don't use O_DIRECT if not available
O_DIRECT is not defined on OSX. Since direct IO is only a new
optimization and not needed for correct functionality, disable
it if O_DIRECT is unavailable.
Signed-off-by: Andreas Dilger <adilger@...mcloud.com>
---
lib/ext2fs/unix_io.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 6e480b7..dddaf6f 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -474,8 +474,10 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel)
open_flags = (flags & IO_FLAG_RW) ? O_RDWR : O_RDONLY;
if (flags & IO_FLAG_EXCLUSIVE)
open_flags |= O_EXCL;
+#ifdef O_DIRECT
if (flags & IO_FLAG_DIRECT_IO)
open_flags |= O_DIRECT;
+#endif
data->flags = flags;
#ifdef HAVE_OPEN64
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists