ext2fs: don't use O_DIRECT if not available
PATCH 1/1 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 <[email protected]>
--- lib/ext2fs/unix_io.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
lib/ext2fs/unix_io.c +2 -0
@@ -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
Signature · 1 line
1.7.3.4
Ted Ts'o
AppliedQuoted 5 lines · Andreas Dilger
O_DIRECTis not defined on OSX. Since direct IO is only a new optimization and not needed for correct functionality, disable it ifO_DIRECTis unavailable.Signed-off-by Andreas Dilger <[email protected]>
Applied to the next branch, thanks.
- Ted