summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackend.h
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2009-06-30 23:19:01 -0400
committerAlexander Larsson <alexl@redhat.com>2009-07-08 13:53:04 +0200
commit8af5a5581e11d9c07e8ba3a17eb2cc93b5c70631 (patch)
tree47206e3fdc7532a97deacb836ec5c79042661421 /daemon/gvfsbackend.h
parentc33e26d3914e0659d4a317fda7fe9acbb6269dc9 (diff)
Bug 587484 – Interaction when unmounting mounts and misc fixes
- Port everything to use _with_operation() variants of unmount/eject methods - Add support for g_file_poll_mountable() - new job class: GVfsJobPollMountable - Pass mount operation for unmount/eject ops on GDaemonFile and GDaemonMount - receive in the appropriate GVfsJob classes - also pass unmount flags where it was missing - port all backends to use this - Teach GMountSource and GMountOperationDBus about the new GMountOperation::show-processes signal - also provide new API - g_mount_source_is_dummy() - e.g. when the client didn't passed NULL for the GMountOperation - g_mount_source_abort() - to send the ::abort signal to the client-side GMountOperation - make the client-side of GMountSource return ::reply with NOT_HANDLED when we do an abort - Refactor the mount operation handling in GProxyVolumeMonitor - Pass mount operation for unmount/ejects in GProxyVolumeMonitor - Pass the process id of the actual reader/writer in OpenForRead and OpenForWrite daemon methods - add some private API for making the FUSE client set the pid of the POSIX client (otherwise it looks like the FUSE client is blocking) and pass the right pid. This is because the FUSE client is basically impersonating the POSIX processes. - Make the process id mentioned above available in appropriate GVfsJob classes - GVfsJobOpenForRead - GVfsJobOpenForWrite - GVfsChannel - Provide API to get a list of all blocking clients, e.g. an array of GPid - g_vfs_daemon_get_blocking_processes() - Provide convenience API to easily doing the right thing on unmount; e.g. interact with the user about blocking processes - see the gphoto2 backend for example usage - g_vfs_backend_has_blocking_processes() - g_vfs_backend_unmount_with_operation() and g_vfs_backend_unmount_with_operation_finish() - Only the gphoto2 backend supports ::show-processes right now. Support for other backends will be added shortly. - Implement support for ::show-processes in the GDU volume monitor - right now we don't support "Unmount Anyway" since it requires ABI changes in libgdu.so - this will be changed as soon as there's a new gnome-disk-utility release
Diffstat (limited to 'daemon/gvfsbackend.h')
-rw-r--r--daemon/gvfsbackend.h43
1 files changed, 35 insertions, 8 deletions
diff --git a/daemon/gvfsbackend.h b/daemon/gvfsbackend.h
index ee68bd86..137001e2 100644
--- a/daemon/gvfsbackend.h
+++ b/daemon/gvfsbackend.h
@@ -49,6 +49,7 @@ typedef struct _GVfsJobMountMountable GVfsJobMountMountable;
typedef struct _GVfsJobUnmountMountable GVfsJobUnmountMountable;
typedef struct _GVfsJobStartMountable GVfsJobStartMountable;
typedef struct _GVfsJobStopMountable GVfsJobStopMountable;
+typedef struct _GVfsJobPollMountable GVfsJobPollMountable;
typedef struct _GVfsJobOpenForRead GVfsJobOpenForRead;
typedef struct _GVfsJobOpenIconForRead GVfsJobOpenIconForRead;
typedef struct _GVfsJobSeekRead GVfsJobSeekRead;
@@ -100,9 +101,13 @@ struct _GVfsBackendClass
*/
void (*unmount) (GVfsBackend *backend,
- GVfsJobUnmount *job);
+ GVfsJobUnmount *job,
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
gboolean (*try_unmount) (GVfsBackend *backend,
- GVfsJobUnmount *job);
+ GVfsJobUnmount *job,
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
void (*mount) (GVfsBackend *backend,
GVfsJobMount *job,
GMountSpec *mount_spec,
@@ -124,19 +129,23 @@ struct _GVfsBackendClass
void (*unmount_mountable) (GVfsBackend *backend,
GVfsJobUnmountMountable *job,
const char *filename,
- GMountUnmountFlags flags);
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
gboolean (*try_unmount_mountable)(GVfsBackend *backend,
GVfsJobUnmountMountable *job,
const char *filename,
- GMountUnmountFlags flags);
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
void (*eject_mountable) (GVfsBackend *backend,
GVfsJobUnmountMountable *job,
const char *filename,
- GMountUnmountFlags flags);
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
gboolean (*try_eject_mountable)(GVfsBackend *backend,
GVfsJobUnmountMountable *job,
const char *filename,
- GMountUnmountFlags flags);
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
void (*open_for_read) (GVfsBackend *backend,
GVfsJobOpenForRead *job,
const char *filename);
@@ -429,11 +438,19 @@ struct _GVfsBackendClass
void (*stop_mountable) (GVfsBackend *backend,
GVfsJobStopMountable *job,
const char *filename,
- GMountUnmountFlags flags);
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
gboolean (*try_stop_mountable) (GVfsBackend *backend,
GVfsJobStopMountable *job,
const char *filename,
- GMountUnmountFlags flags);
+ GMountUnmountFlags flags,
+ GMountSource *mount_source);
+ void (*poll_mountable) (GVfsBackend *backend,
+ GVfsJobPollMountable *job,
+ const char *filename);
+ gboolean (*try_poll_mountable) (GVfsBackend *backend,
+ GVfsJobPollMountable *job,
+ const char *filename);
};
GType g_vfs_backend_get_type (void) G_GNUC_CONST;
@@ -478,6 +495,16 @@ void g_vfs_backend_add_auto_info (GVfsBackend
GFileInfo *info,
const char *uri);
+gboolean g_vfs_backend_has_blocking_processes (GVfsBackend *backend);
+
+gboolean g_vfs_backend_unmount_with_operation_finish (GVfsBackend *backend,
+ GAsyncResult *res);
+
+void g_vfs_backend_unmount_with_operation (GVfsBackend *backend,
+ GMountSource *mount_source,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
G_END_DECLS
#endif /* __G_VFS_BACKEND_H__ */