diff --git a/.gitignore b/.gitignore index eed0302..803af7a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ gvfs-1.6.3.tar.bz2 /gvfs-1.8.1.tar.bz2 /gvfs-1.9.0.tar.bz2 /gvfs-1.9.1.tar.xz +/gvfs-1.9.2.tar.xz diff --git a/gvfs-1.9.2-fuse-statfs.patch b/gvfs-1.9.2-fuse-statfs.patch new file mode 100644 index 0000000..cc9720f --- /dev/null +++ b/gvfs-1.9.2-fuse-statfs.patch @@ -0,0 +1,116 @@ +From 41eaac3a128459b41a13bc2b7da0d48b275f954b Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Wed, 27 Jul 2011 12:15:04 +0200 +Subject: [PATCH] fuse: Bring back real statfs() + +https://bugzilla.gnome.org/show_bug.cgi?id=655401 +--- + client/gvfsfusedaemon.c | 67 ++++++++++++---------------------------------- + 1 files changed, 18 insertions(+), 49 deletions(-) + +diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c +index 4a772fa..b41e83b 100644 +--- a/client/gvfsfusedaemon.c ++++ b/client/gvfsfusedaemon.c +@@ -634,12 +634,6 @@ file_from_full_path (const gchar *path) + * VFS functions * + * ------------- */ + +-#if 0 +- +-/* A stat -f on a FUSE mount always results in this function being called with a path +- * of '/'. This means we can't return valid info for the various mounts. Hopefully we can +- * fix this in the future. */ +- + static gint + vfs_statfs (const gchar *path, struct statvfs *stbuf) + { +@@ -649,32 +643,35 @@ vfs_statfs (const gchar *path, struct statvfs *stbuf) + + debug_print ("vfs_statfs: %s\n", path); + ++ memset (stbuf, 0, sizeof (*stbuf)); ++ ++ /* Fallback case */ ++ stbuf->f_bsize = 4096; ++ stbuf->f_frsize = 4096; /* Ignored by FUSE */ ++ stbuf->f_blocks = 0; ++ stbuf->f_bfree = 0; ++ stbuf->f_bavail = 0; ++ stbuf->f_files = 0; ++ stbuf->f_ffree = 0; ++ stbuf->f_favail = 0; /* Ignored by FUSE */ ++ stbuf->f_fsid = 1; /* Ignored by FUSE */ ++ stbuf->f_flag = 0; /* Ignored by FUSE */ ++ stbuf->f_namemax = 1024; ++ + if ((file = file_from_full_path (path))) + { + GFileInfo *file_info; + +- file_info = g_file_get_filesystem_info (file, "*", NULL, &error); ++ file_info = g_file_query_filesystem_info (file, "filesystem::*", NULL, &error); + + if (file_info) + { +- memset (stbuf, 0, sizeof (*stbuf)); +- +- stbuf->f_bsize = 4096; +- stbuf->f_frsize = 4096; /* Ignored by FUSE */ +- stbuf->f_blocks = 0; +- stbuf->f_bfree = 0; +- stbuf->f_bavail = 0; +- stbuf->f_files = 0; +- stbuf->f_ffree = 0; +- stbuf->f_favail = 0; /* Ignored by FUSE */ +- stbuf->f_fsid = 1; /* Ignored by FUSE */ +- stbuf->f_flag = 0; /* Ignored by FUSE */ +- stbuf->f_namemax = 1024; +- + if (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE)) + stbuf->f_blocks = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE) / 4096; + if (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE)) + stbuf->f_bfree = stbuf->f_bavail = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE) / 4096; ++ ++ g_object_unref (file_info); + } + else if (error) + { +@@ -694,34 +691,6 @@ vfs_statfs (const gchar *path, struct statvfs *stbuf) + return result; + } + +-#endif +- +-static gint +-vfs_statfs (const gchar *path, struct statvfs *stbuf) +-{ +- gint result = 0; +- +- debug_print ("vfs_statfs: %s\n", path); +- +- memset (stbuf, 0, sizeof (*stbuf)); +- +- stbuf->f_bsize = 4096; +- stbuf->f_frsize = 4096; /* Ignored by FUSE */ +- stbuf->f_blocks = 0; +- stbuf->f_bfree = 0; +- stbuf->f_bavail = 0; +- stbuf->f_files = 0; +- stbuf->f_ffree = 0; +- stbuf->f_favail = 0; /* Ignored by FUSE */ +- stbuf->f_fsid = 1; /* Ignored by FUSE */ +- stbuf->f_flag = 0; /* Ignored by FUSE */ +- stbuf->f_namemax = 1024; +- +- debug_print ("vfs_statfs: -> %s\n", g_strerror (-result)); +- +- return result; +-} +- + static mode_t + file_info_get_stat_mode (GFileInfo *file_info) + { +-- +1.7.6 + diff --git a/gvfs.spec b/gvfs.spec index d3531a7..6628c1b 100644 --- a/gvfs.spec +++ b/gvfs.spec @@ -1,6 +1,6 @@ Summary: Backends for the gio framework in GLib Name: gvfs -Version: 1.9.1 +Version: 1.9.2 Release: 1%{?dist} License: LGPLv2+ Group: System Environment/Libraries @@ -34,6 +34,8 @@ BuildRequires: libtool # http://bugzilla.gnome.org/show_bug.cgi?id=567235 Patch0: gvfs-archive-integration.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=655401 +Patch1: gvfs-1.9.2-fuse-statfs.patch Obsoletes: gnome-mount <= 0.8 Obsoletes: gnome-mount-nautilus-properties <= 0.8 @@ -131,6 +133,7 @@ including phones and music players to applications using gvfs. %prep %setup -q %patch0 -p1 -b .archive-integration +%patch1 -p1 -b .fuse-statfs %build @@ -277,7 +280,7 @@ killall -USR1 gvfsd >&/dev/null || : %files archive %defattr(-, root, root, -) -%dir %{_datadir}/applications/mount-archive.desktop +%{_datadir}/applications/mount-archive.desktop %{_libexecdir}/gvfsd-archive %{_datadir}/gvfs/mounts/archive.mount @@ -307,6 +310,10 @@ killall -USR1 gvfsd >&/dev/null || : %endif %changelog +* Wed Jul 27 2011 Tomas Bzatek - 1.9.2-1 +- Update to 1.9.2 +- Enable real statfs calls in the fuse daemon + * Wed Jun 15 2011 Tomas Bzatek - 1.9.1-1 - Update to 1.9.1 diff --git a/sources b/sources index c91b1d4..b330c8c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -cfdcf374fce8f1aac021a070a6091969 gvfs-1.9.1.tar.xz +047ad1950c36a0cb8c8821b8f038a05d gvfs-1.9.2.tar.xz