[Ocfs2-tools-commits] jlbec commits r245 - in trunk/libocfs2: .
include
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Sep 21 16:05:11 CDT 2004
Author: jlbec
Date: 2004-09-21 16:05:09 -0500 (Tue, 21 Sep 2004)
New Revision: 245
Modified:
trunk/libocfs2/include/ocfs2.h
trunk/libocfs2/openfs.c
trunk/libocfs2/unix_io.c
Log:
o Add OCFS2_FLAG_BUFFERED to open w/o O_DIRECT.
Modified: trunk/libocfs2/include/ocfs2.h
===================================================================
--- trunk/libocfs2/include/ocfs2.h 2004-09-20 23:02:52 UTC (rev 244)
+++ trunk/libocfs2/include/ocfs2.h 2004-09-21 21:05:09 UTC (rev 245)
@@ -63,6 +63,7 @@
#define OCFS2_FLAG_CHANGED 0x02
#define OCFS2_FLAG_DIRTY 0x04
#define OCFS2_FLAG_SWAP_BYTES 0x08
+#define OCFS2_FLAG_BUFFERED 0x10
/* Return flags for the extent iterator functions */
#define OCFS2_EXTENT_CHANGED 0x01
Modified: trunk/libocfs2/openfs.c
===================================================================
--- trunk/libocfs2/openfs.c 2004-09-20 23:02:52 UTC (rev 244)
+++ trunk/libocfs2/openfs.c 2004-09-21 21:05:09 UTC (rev 245)
@@ -154,7 +154,8 @@
fs->fs_flags = flags;
fs->fs_umask = 022;
- ret = io_open(name, (flags & (OCFS2_FLAG_RO | OCFS2_FLAG_RW)),
+ ret = io_open(name, (flags & (OCFS2_FLAG_RO | OCFS2_FLAG_RW |
+ OCFS2_FLAG_BUFFERED)),
&fs->fs_io);
if (ret)
goto out;
Modified: trunk/libocfs2/unix_io.c
===================================================================
--- trunk/libocfs2/unix_io.c 2004-09-20 23:02:52 UTC (rev 244)
+++ trunk/libocfs2/unix_io.c 2004-09-21 21:05:09 UTC (rev 245)
@@ -100,8 +100,8 @@
strcpy(chan->io_name, name);
chan->io_blksize = OCFS2_MIN_BLOCKSIZE;
chan->io_flags = (flags & OCFS2_FLAG_RW) ? O_RDWR : O_RDONLY;
- /* FIXME: should do a "check for success, fallback to bindraw */
- chan->io_flags |= O_DIRECT;
+ if (!(flags & OCFS2_FLAG_BUFFERED))
+ chan->io_flags |= O_DIRECT;
chan->io_error = 0;
ret = OCFS2_ET_IO;
@@ -111,9 +111,11 @@
goto out_name;
}
- ret = io_validate_o_direct(chan);
- if (ret)
- goto out_close; /* FIXME: bindraw here */
+ if (!(flags & OCFS2_FLAG_BUFFERED)) {
+ ret = io_validate_o_direct(chan);
+ if (ret)
+ goto out_close; /* FIXME: bindraw here */
+ }
/* Workaround from e2fsprogs */
#ifdef __linux__
More information about the Ocfs2-tools-commits
mailing list