summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2013-10-08 08:21:47 +0200
committerAlexander Larsson <alexl@redhat.com>2013-10-08 11:16:20 +0200
commit8835238a5d0049e7639f792bf82d2105ad54cc11 (patch)
tree052ce3ffb417cfe54c6e90ec445c84d48cf98a98
parent1474a61207aa33362a674abe674c822691a57331 (diff)
downloadgvfs-8835238a5d0049e7639f792bf82d2105ad54cc11.tar.gz
fuse: Use the big_writes option to speed up writes
Without the big_writes option, fuse uses a block size of 4096 bytes which results in poor write performance. So use the big_writes option to write blocks up to 64KiB in size. https://bugzilla.gnome.org/show_bug.cgi?id=652540
-rw-r--r--client/gvfsfusedaemon.c4
-rw-r--r--daemon/main.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 3f92a1d6..e2a59b05 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -2397,6 +2397,10 @@ vfs_init (struct fuse_conn_info *conn)
/* Prevent out-of-order readahead */
conn->async_read = 0;
+ /* Use up to a 64KiB write block size. Only has an effect if -o big_writes
+ * is given on the command-line. */
+ conn->max_write = 65536;
+
return NULL;
}
diff --git a/daemon/main.c b/daemon/main.c
index f394a32c..1255ddf6 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -83,7 +83,7 @@ on_name_acquired (GDBusConnection *connection,
if (!no_fuse)
{
char *fuse_path;
- char *argv2[4];
+ char *argv2[6];
/* Use the old .gvfs location as fallback, not .cache/gvfs */
if (g_get_user_runtime_dir() == g_get_user_cache_dir ())
@@ -101,9 +101,11 @@ on_name_acquired (GDBusConnection *connection,
/* Opengroup. On system with the uClibc library this will badly */
/* hang the process. */
argv2[0] = LIBEXEC_DIR "/gvfsd-fuse";
- argv2[1] = "-f";
- argv2[2] = fuse_path;
- argv2[3] = NULL;
+ argv2[1] = fuse_path;
+ argv2[2] = "-f";
+ argv2[3] = "-o";
+ argv2[4] = "big_writes";
+ argv2[5] = NULL;
g_spawn_async (NULL,
argv2,