summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonmount.c4
-rw-r--r--client/gdaemonvfs.c16
-rw-r--r--client/gdaemonvfs.h3
-rw-r--r--client/gvfsdaemondbus.c4
4 files changed, 21 insertions, 6 deletions
diff --git a/client/gdaemonmount.c b/client/gdaemonmount.c
index e4acef0a..60dd8bf3 100644
--- a/client/gdaemonmount.c
+++ b/client/gdaemonmount.c
@@ -210,9 +210,13 @@ unmount_reply (GVfsDBusMount *proxy,
GAsyncResult *res,
gpointer user_data)
{
+ GDBusProxy *base_proxy = G_DBUS_PROXY (proxy);
AsyncProxyCreate *data = user_data;
GError *error = NULL;
+ _g_daemon_vfs_invalidate (g_dbus_proxy_get_name (base_proxy),
+ g_dbus_proxy_get_object_path (base_proxy));
+
if (! gvfs_dbus_mount_call_unmount_finish (proxy, res, &error))
{
_g_simple_async_result_take_error_stripped (data->result, error);
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 7a6dc0aa..9ab806b3 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -740,9 +740,18 @@ lookup_mount_info_by_fuse_path_in_cache (const char *fuse_path,
return info;
}
-
+/*
+ * _g_daemon_vfs_invalidate:
+ * @dbus_id: the D-Bus unique name of the backend process
+ * @object_path: the object path of the mount, or %NULL to invalidate
+ * all mounts in that process
+ *
+ * Invalidate cache entries because we get out-of-band information that
+ * something has been mounted or unmounted.
+ */
void
-_g_daemon_vfs_invalidate_dbus_id (const char *dbus_id)
+_g_daemon_vfs_invalidate (const char *dbus_id,
+ const char *object_path)
{
GList *l, *next;
@@ -752,7 +761,8 @@ _g_daemon_vfs_invalidate_dbus_id (const char *dbus_id)
GMountInfo *mount_info = l->data;
next = l->next;
- if (strcmp (mount_info->dbus_id, dbus_id) == 0)
+ if (strcmp (mount_info->dbus_id, dbus_id) == 0 &&
+ (object_path == NULL || strcmp (mount_info->object_path, object_path) == 0))
{
the_vfs->mount_cache = g_list_delete_link (the_vfs->mount_cache, l);
g_mount_info_unref (mount_info);
diff --git a/client/gdaemonvfs.h b/client/gdaemonvfs.h
index c5ecefc5..5d5195d4 100644
--- a/client/gdaemonvfs.h
+++ b/client/gdaemonvfs.h
@@ -67,7 +67,8 @@ GMountInfo * _g_daemon_vfs_get_mount_info_by_fuse_sync (const char *fuse_path
GMountSpec * _g_daemon_vfs_get_mount_spec_for_path (GMountSpec *spec,
const char *path,
const char *new_path);
-void _g_daemon_vfs_invalidate_dbus_id (const char *dbus_id);
+void _g_daemon_vfs_invalidate (const char *dbus_id,
+ const char *object_path);
GDBusConnection *_g_daemon_vfs_get_async_bus (void);
int _g_daemon_vfs_append_metadata_for_set (GVariantBuilder *builder,
MetaTree *tree,
diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c
index b74370c1..dc5f50ff 100644
--- a/client/gvfsdaemondbus.c
+++ b/client/gvfsdaemondbus.c
@@ -81,7 +81,7 @@ vfs_connection_closed (GDBusConnection *connection,
if (connection_data->async_dbus_id)
{
- _g_daemon_vfs_invalidate_dbus_id (connection_data->async_dbus_id);
+ _g_daemon_vfs_invalidate (connection_data->async_dbus_id, NULL);
G_LOCK (async_map);
g_hash_table_remove (async_map, connection_data->async_dbus_id);
G_UNLOCK (async_map);
@@ -472,7 +472,7 @@ invalidate_local_connection (const char *dbus_id,
{
ThreadLocalConnections *local;
- _g_daemon_vfs_invalidate_dbus_id (dbus_id);
+ _g_daemon_vfs_invalidate (dbus_id, NULL);
local = g_private_get (&local_connections);
if (local)