summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-04-06 02:15:40 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-08 03:08:35 -0700
commit9daf76661fcaee2e607b371c91cb7600f51bf678 (patch)
tree045232c33b55e6be2f4cc8737837b5c967e30c62 /xlators/mount
parent286b913e6335d23796883e729e014b486817f38c (diff)
fuse: change behavior of direct io mode.
by default disable direct-io only for fds opened with O_RDONLY. (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/mount')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 1dc710c96..8f6dabd0a 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -621,7 +621,9 @@ fuse_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
fi.flags = state->flags;
if (!S_ISDIR (fd->inode->st_mode)) {
- if ((fi.flags & 3) && priv->direct_io_mode)
+ if (((priv->direct_io_mode == 2)
+ && ((state->flags & O_ACCMODE) != O_RDONLY))
+ || (priv->direct_io_mode == 1))
fi.direct_io = 1;
}
@@ -1327,7 +1329,9 @@ fuse_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret >= 0) {
fi.fh = (unsigned long) fd;
- if ((fi.flags & 3) && priv->direct_io_mode)
+ if (((priv->direct_io_mode == 2)
+ && ((state->flags & O_ACCMODE) != O_RDONLY))
+ || (priv->direct_io_mode == 1))
fi.direct_io = 1;
gf_log ("glusterfs-fuse", GF_LOG_TRACE,
@@ -2372,7 +2376,7 @@ fuse_setlk (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi,
static void
fuse_init (void *data, struct fuse_conn_info *conn)
{
- return;
+
}
static void
@@ -2793,7 +2797,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);