* [PATCH] ext2fs: don't use O_DIRECT if not available
@ 2011-06-10 7:15 Andreas Dilger
2011-06-11 15:50 ` Ted Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Dilger @ 2011-06-10 7:15 UTC (permalink / raw)
To: tytso, linux-ext4; +Cc: Andreas Dilger
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@whamcloud.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext2fs: don't use O_DIRECT if not available
2011-06-10 7:15 [PATCH] ext2fs: don't use O_DIRECT if not available Andreas Dilger
@ 2011-06-11 15:50 ` Ted Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-06-11 15:50 UTC (permalink / raw)
To: Andreas Dilger; +Cc: linux-ext4
On Fri, Jun 10, 2011 at 01:15:30AM -0600, Andreas Dilger wrote:
> 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@whamcloud.com>
Applied to the next branch, thanks.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-11 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 7:15 [PATCH] ext2fs: don't use O_DIRECT if not available Andreas Dilger
2011-06-11 15:50 ` Ted Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).