summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-04-06 02:10:52 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-08 03:08:57 -0700
commit0f892d517b1907e2bd8cb3ac26699e2027d67fe6 (patch)
tree41676a1e3a4bd94452176da11f28e46363094997 /xlators
parente23f987bb4796c46d4addba1f6df2cc3ab674086 (diff)
fuse: change behavior of direct io mode.
If bigwrites are available, then disable direct io mode only by default (previously direct io mode was disabled in any case). Added new command line option to force enabling of direct io mode Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 801 (Direct io-mode support and related changes in caching translators.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=801
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index a51cf6eed98..b01bf4cdffc 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -833,8 +833,9 @@ fuse_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
foo.open_flags = 0;
if (!S_ISDIR (fd->inode->st_mode)) {
- if (((state->flags & O_ACCMODE) != O_RDONLY) &&
- priv->direct_io_mode)
+ if (((priv->direct_io_mode == 2)
+ && ((state->flags & O_ACCMODE) != O_RDONLY))
+ || (priv->direct_io_mode == 1))
foo.open_flags |= FOPEN_DIRECT_IO;
}
@@ -1648,8 +1649,9 @@ fuse_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret >= 0) {
foo.fh = (uintptr_t) fd;
- if (((state->flags & O_ACCMODE) != O_RDONLY) &&
- priv->direct_io_mode)
+ if (((priv->direct_io_mode == 2)
+ && ((state->flags & O_ACCMODE) != O_RDONLY))
+ || (priv->direct_io_mode == 1))
foo.open_flags |= FOPEN_DIRECT_IO;
gf_log ("glusterfs-fuse", GF_LOG_TRACE,
@@ -2920,8 +2922,14 @@ fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg)
fino.flags = FUSE_ASYNC_READ | FUSE_POSIX_LOCKS;
if (fini->minor >= 6 /* fuse_init_in has flags */ &&
fini->flags & FUSE_BIG_WRITES) {
- /* no need for direct I/O mode if big writes are supported */
- priv->direct_io_mode = 0;
+ /*
+ * no need for direct I/O mode by default if big writes are
+ * supported
+ */
+ if (priv->direct_io_mode == 2) {
+ priv->direct_io_mode = 0;
+ }
+
fino.flags |= FUSE_BIG_WRITES;
}
if (fini->minor >= 13) {
@@ -3422,7 +3430,7 @@ init (xlator_t *this_xl)
priv->entry_timeout = 1.0; /* default */
- priv->direct_io_mode = 1;
+ priv->direct_io_mode = 2;
ret = dict_get_str (options, ZR_DIRECT_IO_OPT, &value_string);
if (value_string) {
ret = gf_string2boolean (value_string, &priv->direct_io_mode);