diff options
author | Raghavendra G <raghavendra@gluster.com> | 2010-08-25 04:37:44 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-21 04:02:39 -0700 |
commit | 6dbd6185483591fc2f83beee9d2766d1ea0c61a4 (patch) | |
tree | 6b2ace0057bb95267b4bcfb20cdd95dba1e78c5e /xlators/mount/fuse/src | |
parent | 7547953e3a7a458d60f8bbfef8e141aff087bfa3 (diff) |
mount/fuse: By default enable direct-io only for fds not openened with O_RDONLY.v3.1.0qa27
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Vijay Bellur <vijay@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/mount/fuse/src')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 686391b920f..122304446ef 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -532,7 +532,9 @@ fuse_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this, foo.open_flags = 0; if (!IA_ISDIR (fd->inode->ia_type)) { - if (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; #ifdef GF_DARWIN_HOST_OS /* In Linux: by default, buffer cache @@ -1435,7 +1437,9 @@ fuse_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (op_ret >= 0) { foo.fh = (uintptr_t) fd; - if (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, |