diff --git a/doc/udisks2-sections.txt.daemon.sections.in b/doc/udisks2-sections.txt.daemon.sections.in index 204ca89775..7803ff2b91 100644 --- a/doc/udisks2-sections.txt.daemon.sections.in +++ b/doc/udisks2-sections.txt.daemon.sections.in @@ -237,7 +237,6 @@ udisks_state_new udisks_state_start_cleanup udisks_state_stop_cleanup udisks_state_check -udisks_state_check_sync udisks_state_check_block udisks_state_get_daemon diff --git a/modules/btrfs/udiskslinuxfilesystembtrfs.c b/modules/btrfs/udiskslinuxfilesystembtrfs.c index c7558a6c20..ba3e4f105c 100644 --- a/modules/btrfs/udiskslinuxfilesystembtrfs.c +++ b/modules/btrfs/udiskslinuxfilesystembtrfs.c @@ -436,7 +436,7 @@ btrfs_subvolume_perform_action (UDisksFilesystemBTRFS *fs_btrfs, udisks_linux_block_object_trigger_uevent_sync (object, UDISKS_DEFAULT_WAIT_TIMEOUT); /* Complete DBus call. */ - udisks_filesystem_btrfs_complete_set_label (fs_btrfs, invocation); + g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); out: /* Release the resources */ @@ -519,12 +519,12 @@ btrfs_device_perform_action (UDisksFilesystemBTRFS *fs_btrfs, goto out; } - /* Update the interface. */ + /* Trigger uevent on the filesystem and on the added/removed device */ udisks_linux_block_object_trigger_uevent_sync (object, UDISKS_DEFAULT_WAIT_TIMEOUT); - udisks_linux_filesystem_btrfs_update (l_fs_btrfs, object); + udisks_daemon_util_trigger_uevent_sync (daemon, device, NULL, UDISKS_DEFAULT_WAIT_TIMEOUT); /* Complete DBus call. */ - udisks_filesystem_btrfs_complete_add_device (fs_btrfs, invocation); + g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); out: /* Release the resources */ diff --git a/src/udisksstate.c b/src/udisksstate.c index a4c266e8a2..c2ad668b2e 100644 --- a/src/udisksstate.c +++ b/src/udisksstate.c @@ -425,64 +425,6 @@ udisks_state_check (UDisksState *state) state); } - -typedef struct -{ - UDisksState *state; - gboolean finished; - GCond cond; - GMutex data_mutex; -} UDisksStateCheckSyncData; - -static gboolean -udisks_state_check_sync_func (UDisksStateCheckSyncData *data) -{ - udisks_state_check_in_thread (data->state); - - /* signal the calling thread the cleanup has finished */ - g_mutex_lock (&data->data_mutex); - data->finished = TRUE; - g_cond_signal (&data->cond); - g_mutex_unlock (&data->data_mutex); - - return FALSE; -} - -/** - * udisks_state_check_sync: - * @state: A #UDisksState. - * - * Causes the clean-up thread for @state to check if anything should be cleaned up and perform the cleanup. - * - * This can be called from any thread and in contrast to udisks_state_check() will block the calling thread until cleanup is finished. - */ -void -udisks_state_check_sync (UDisksState *state) -{ - UDisksStateCheckSyncData data = {0, }; - - g_return_if_fail (UDISKS_IS_STATE (state)); - g_return_if_fail (state->thread != NULL); - - g_cond_init (&data.cond); - g_mutex_init (&data.data_mutex); - data.state = state; - data.finished = FALSE; - - g_mutex_lock (&data.data_mutex); - g_main_context_invoke (state->context, - (GSourceFunc) udisks_state_check_sync_func, - &data); - - /* wait for the mainloop running in the cleanup thread to process our injected task */ - while (!data.finished) - g_cond_wait (&data.cond, &data.data_mutex); - g_mutex_unlock (&data.data_mutex); - - g_cond_clear (&data.cond); - g_mutex_clear (&data.data_mutex); -} - /** * udisks_state_check_block: * @state: A #UDisksState. diff --git a/src/udisksstate.h b/src/udisksstate.h index ea1cf4e7b5..2ae7b9c39e 100644 --- a/src/udisksstate.h +++ b/src/udisksstate.h @@ -35,7 +35,6 @@ UDisksDaemon *udisks_state_get_daemon (UDisksState *state); void udisks_state_start_cleanup (UDisksState *state); void udisks_state_stop_cleanup (UDisksState *state); void udisks_state_check (UDisksState *state); -void udisks_state_check_sync (UDisksState *state); void udisks_state_check_block (UDisksState *state, dev_t block_device); /* mounted-fs */