diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2013-05-13 17:43:19 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2013-05-13 17:43:19 +0200 |
commit | c8e7d1375715545f28a0943ce7657330e3b70acd (patch) | |
tree | 3847d01839c94e62e50650a06f738c0cddfb72e1 /metadata/meta-daemon.c | |
parent | 749c872b9192a84e65d83bc0f0eb697ab247fdd8 (diff) | |
download | gvfs-c8e7d1375715545f28a0943ce7657330e3b70acd.tar.gz |
metadata: Use shorter writeout timeout on NFS
Since we've moved journal to a non-volatile storage, let's flush
more often to minimize a chance of data loss.
https://bugzilla.gnome.org/show_bug.cgi?id=637095
Diffstat (limited to 'metadata/meta-daemon.c')
-rw-r--r-- | metadata/meta-daemon.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/metadata/meta-daemon.c b/metadata/meta-daemon.c index ce34b735..f29e7f0b 100644 --- a/metadata/meta-daemon.c +++ b/metadata/meta-daemon.c @@ -32,6 +32,7 @@ #include "metadata-dbus.h" #define WRITEOUT_TIMEOUT_SECS 60 +#define WRITEOUT_TIMEOUT_SECS_NFS 15 typedef struct { char *filename; @@ -67,10 +68,15 @@ writeout_timeout (gpointer data) static void tree_info_schedule_writeout (TreeInfo *info) { + gboolean on_nfs; + if (info->writeout_timeout == 0) - info->writeout_timeout = - g_timeout_add_seconds (WRITEOUT_TIMEOUT_SECS, - writeout_timeout, info); + { + on_nfs = meta_tree_is_on_nfs (info->tree); + info->writeout_timeout = + g_timeout_add_seconds (on_nfs ? WRITEOUT_TIMEOUT_SECS_NFS : WRITEOUT_TIMEOUT_SECS, + writeout_timeout, info); + } } static TreeInfo * |