summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--client/gvfsfusedaemon.c25
2 files changed, 30 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f7541b9..d96fa5ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-13 Hans Petter Jansson <hpj@novell.com>
+
+ * client/gvfsfusedaemon.c (getattr_for_file)
+ (vfs_open)
+ (vfs_create)
+ (vfs_rmdir)
+ (vfs_access): Get only the attributes we require. This speeds up
+ directory listings in particular, since we don't need to probe
+ individual files to determine their MIME types.
+
2009-01-12 Ryan Lortie <desrt@desrt.ca>
* daemon/trashlib/trashitem.c: don't insta-thaw deletes
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index b61e96c2..af7d5a57 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -751,7 +751,18 @@ getattr_for_file (GFile *file, struct stat *sbuf)
GError *error = NULL;
gint result = 0;
- file_info = g_file_query_info (file, "*", 0, NULL, &error);
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE ","
+ G_FILE_ATTRIBUTE_STANDARD_NAME ","
+ G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK ","
+ G_FILE_ATTRIBUTE_STANDARD_SIZE ","
+ G_FILE_ATTRIBUTE_UNIX_MODE ","
+ G_FILE_ATTRIBUTE_TIME_CHANGED ","
+ G_FILE_ATTRIBUTE_TIME_MODIFIED ","
+ G_FILE_ATTRIBUTE_TIME_ACCESS ","
+ G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE ","
+ G_FILE_ATTRIBUTE_UNIX_BLOCKS,
+ 0, NULL, &error);
if (file_info)
{
@@ -962,7 +973,7 @@ vfs_open (const gchar *path, struct fuse_file_info *fi)
GFileInfo *file_info;
GError *error = NULL;
- file_info = g_file_query_info (file, "*", 0, NULL, &error);
+ file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &error);
if (file_info)
{
@@ -1046,7 +1057,7 @@ vfs_create (const gchar *path, mode_t mode, struct fuse_file_info *fi)
GFileInfo *file_info;
GError *error = NULL;
- file_info = g_file_query_info (file, "*", 0, NULL, &error);
+ file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &error);
if (file_info)
{
@@ -1687,7 +1698,7 @@ vfs_rmdir (const gchar *path)
{
GFileInfo *file_info;
- file_info = g_file_query_info (file, "*", 0, NULL, &error);
+ file_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE, 0, NULL, &error);
if (file_info)
{
if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
@@ -1903,7 +1914,11 @@ vfs_access (const gchar *path, gint mode)
{
GFileInfo *file_info;
- file_info = g_file_query_info (file, "*", 0, NULL, &error);
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_ACCESS_CAN_READ ","
+ G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE ","
+ G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE ",",
+ 0, NULL, &error);
if (file_info)
{
if ((mode & R_OK && (g_file_info_has_attribute (file_info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ) &&