[gvfs] fuse: Use the big_writes option to speed up writes



commit 8835238a5d0049e7639f792bf82d2105ad54cc11
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Tue Oct 8 08:21:47 2013 +0200

    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

 client/gvfsfusedaemon.c |    4 ++++
 daemon/main.c           |   10 ++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 3f92a1d..e2a59b0 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 f394a32..1255ddf 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]