--- gio/glocalfile.c.orig       2011-06-01 09:28:19.801519656 -0400
+++ gio/glocalfile.c    2011-06-01 09:47:04.965621974 -0400
@@ -1719,6 +1719,8 @@
   static gsize home_dev_set = 0;
   static dev_t home_dev;
   char *topdir, *globaldir, *trashdir, *tmpname;
+  GFileInfo *dirinfo;
+  gchar *filesystem_type;
   uid_t uid;
   char uid_str[32];
   GStatBuf global_stat, trash_stat;
@@ -1737,6 +1739,20 @@
   if (dir_dev == home_dev)
     return TRUE;

+  /* We cannot trash in AFS, and it's expensive to attempt to
+   * look up the /afs/.Trash* directories.
+   */
+  dirinfo = g_file_query_filesystem_info (
+    g_file_new_for_path(dirname),
+    G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
+    NULL, NULL);
+  if (dirinfo) {
+    filesystem_type = g_strdup(g_file_info_get_attribute_string(
+      dirinfo, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE) );
+    if(strcmp(filesystem_type, "afs"))
+      return FALSE;
+  }
+
   topdir = find_mountpoint_for (dirname, dir_dev);
   if (topdir == NULL)
     return FALSE;

