DevkitDisksDevice *device,
gpointer user_data);
-static gboolean devkit_disks_device_unlock_encrypted_internal (DevkitDisksDevice *device,
+static gboolean devkit_disks_device_encrypted_unlock_internal (DevkitDisksDevice *device,
const char *secret,
char **options,
UnlockEncryptionHookFunc hook_func,
gpointer hook_user_data,
DBusGMethodInvocation *context);
-/* if create_filesystem_succeeded==FALSE, mkfs failed and an error has been reported back to the caller */
-typedef void (*CreateFilesystemHookFunc) (DBusGMethodInvocation *context,
+/* if filesystem_create_succeeded==FALSE, mkfs failed and an error has been reported back to the caller */
+typedef void (*FilesystemCreateHookFunc) (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
- gboolean create_filesystem_succeeded,
+ gboolean filesystem_create_succeeded,
gpointer user_data);
static gboolean
-devkit_disks_device_create_filesystem_internal (DevkitDisksDevice *device,
+devkit_disks_device_filesystem_create_internal (DevkitDisksDevice *device,
const char *fstype,
char **options,
- CreateFilesystemHookFunc hook_func,
+ FilesystemCreateHookFunc hook_func,
gpointer hook_user_data,
DBusGMethodInvocation *context);
*/
linux_md_emit_changed_on_components (device);
}
+ g_warning ("Linux MD array %s is not 'clear'; removing", device->priv->native_path);
goto out;
}
}
if (devkit_device_properties_foreach (device->priv->d, update_info_properties_cb, device)) {
+ g_warning ("Iteration of properties was short circuited for %s", device->priv->native_path);
goto out;
}
raid_level = g_strstrip (sysfs_get_string (device->priv->native_path, "md/level"));
if (raid_level == NULL) {
- g_warning ("Didn't find md/level. Ignoring.");
+ g_warning ("Didn't find md/level for %s. Ignoring.", device->priv->native_path);
goto out;
}
device->priv->info.linux_md_level = raid_level;
} MountData;
static MountData *
-mount_data_new (const char *mount_point, gboolean remove_dir_on_unmount, gboolean is_remount)
+filesystem_mount_data_new (const char *mount_point, gboolean remove_dir_on_unmount, gboolean is_remount)
{
MountData *data;
data = g_new0 (MountData, 1);
}
static void
-mount_data_free (MountData *data)
+filesystem_mount_data_free (MountData *data)
{
g_free (data->mount_point);
g_free (data);
}
static void
-mount_completed_cb (DBusGMethodInvocation *context,
- DevkitDisksDevice *device,
- PolKitCaller *pk_caller,
- gboolean job_was_cancelled,
- int status,
- const char *stderr,
- const char *stdout,
- gpointer user_data)
+filesystem_mount_completed_cb (DBusGMethodInvocation *context,
+ DevkitDisksDevice *device,
+ PolKitCaller *pk_caller,
+ gboolean job_was_cancelled,
+ int status,
+ const char *stderr,
+ const char *stdout,
+ gpointer user_data)
{
MountData *data = (MountData *) user_data;
uid_t uid;
gboolean
-devkit_disks_device_mount (DevkitDisksDevice *device,
- const char *filesystem_type,
- char **given_options,
- DBusGMethodInvocation *context)
+devkit_disks_device_filesystem_mount (DevkitDisksDevice *device,
+ const char *filesystem_type,
+ char **given_options,
+ DBusGMethodInvocation *context)
{
int n;
GString *s;
error = NULL;
if (!job_new (context,
- "Mount",
+ "FilesystemMount",
FALSE,
device,
pk_caller,
argv,
NULL,
- mount_completed_cb,
- mount_data_new (mount_point, remove_dir_on_unmount, is_remount),
- (GDestroyNotify) mount_data_free)) {
+ filesystem_mount_completed_cb,
+ filesystem_mount_data_new (mount_point, remove_dir_on_unmount, is_remount),
+ (GDestroyNotify) filesystem_mount_data_free)) {
if (!is_remount) {
if (g_rmdir (mount_point) != 0) {
g_warning ("Error removing dir in early mount error path: %m");
/*--------------------------------------------------------------------------------------------------------------*/
static void
-unmount_completed_cb (DBusGMethodInvocation *context,
- DevkitDisksDevice *device,
- PolKitCaller *pk_caller,
- gboolean job_was_cancelled,
- int status,
- const char *stderr,
- const char *stdout,
- gpointer user_data)
+filesystem_unmount_completed_cb (DBusGMethodInvocation *context,
+ DevkitDisksDevice *device,
+ PolKitCaller *pk_caller,
+ gboolean job_was_cancelled,
+ int status,
+ const char *stderr,
+ const char *stdout,
+ gpointer user_data)
{
char *mount_path = user_data;
}
gboolean
-devkit_disks_device_unmount (DevkitDisksDevice *device,
- char **options,
- DBusGMethodInvocation *context)
+devkit_disks_device_filesystem_unmount (DevkitDisksDevice *device,
+ char **options,
+ DBusGMethodInvocation *context)
{
int n;
char *argv[16];
error = NULL;
if (!job_new (context,
- "Unmount",
+ "FilesystemUnmount",
FALSE,
device,
pk_caller,
argv,
NULL,
- unmount_completed_cb,
+ filesystem_unmount_completed_cb,
g_strdup (device->priv->info.device_mount_path),
g_free)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-delete_partition_completed_cb (DBusGMethodInvocation *context,
+partition_delete_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_delete_partition (DevkitDisksDevice *device,
+devkit_disks_device_partition_delete (DevkitDisksDevice *device,
char **options,
DBusGMethodInvocation *context)
{
}
#if 0
- /* see rant in devkit_disks_device_create_partition() */
+ /* see rant in devkit_disks_device_partition_create() */
if (devkit_disks_device_local_partitions_are_busy (enclosing_device)) {
throw_error (context, DEVKIT_DISKS_DEVICE_ERROR_IS_BUSY,
"A sibling partition is busy (TODO: addpart/delpart/partx to the rescue!)");
error = NULL;
if (!job_new (context,
- "DeletePartition",
+ "PartitionDelete",
TRUE,
device,
pk_caller,
argv,
NULL,
- delete_partition_completed_cb,
+ partition_delete_completed_cb,
g_object_ref (enclosing_device),
g_object_unref)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
typedef struct {
- CreateFilesystemHookFunc hook_func;
+ FilesystemCreateHookFunc hook_func;
gpointer hook_user_data;
} MkfsData;
}
static void
-create_filesystem_completed_cb (DBusGMethodInvocation *context,
+filesystem_create_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
char **options;
char *fstype;
- CreateFilesystemHookFunc mkfs_hook_func;
+ FilesystemCreateHookFunc mkfs_hook_func;
gpointer mkfs_hook_user_data;
guint device_changed_signal_handler_id;
}
static void
-create_filesystem_wait_for_cleartext_device_hook (DBusGMethodInvocation *context,
+filesystem_create_wait_for_cleartext_device_hook (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
gpointer user_data)
{
* the source. Only the device is different.
*/
- devkit_disks_device_create_filesystem_internal (device,
+ devkit_disks_device_filesystem_create_internal (device,
data->fstype,
data->options,
data->mkfs_hook_func,
}
static void
-create_filesystem_wait_for_encrypted_device_changed_cb (DevkitDisksDaemon *daemon,
+filesystem_create_wait_for_encrypted_device_changed_cb (DevkitDisksDaemon *daemon,
const char *object_path,
gpointer user_data)
{
/* yay! we are now set up the corresponding cleartext device */
- devkit_disks_device_unlock_encrypted_internal (data->device,
+ devkit_disks_device_encrypted_unlock_internal (data->device,
data->passphrase,
NULL,
- create_filesystem_wait_for_cleartext_device_hook,
+ filesystem_create_wait_for_cleartext_device_hook,
data,
data->context);
}
static gboolean
-create_filesystem_wait_for_encrypted_device_not_seen_cb (gpointer user_data)
+filesystem_create_wait_for_encrypted_device_not_seen_cb (gpointer user_data)
{
MkfsEncryptedData *data = user_data;
static void
-create_filesystem_create_encrypted_device_completed_cb (DBusGMethodInvocation *context,
+filesystem_create_create_encrypted_device_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
data->device_changed_signal_handler_id = g_signal_connect_after (
device->priv->daemon,
"device-changed",
- (GCallback) create_filesystem_wait_for_encrypted_device_changed_cb,
+ (GCallback) filesystem_create_wait_for_encrypted_device_changed_cb,
mkfse_data_ref (data));
/* set up timeout for error reporting if waiting failed
*/
data->device_changed_timeout_id = g_timeout_add (
10 * 1000,
- create_filesystem_wait_for_encrypted_device_not_seen_cb,
+ filesystem_create_wait_for_encrypted_device_not_seen_cb,
data);
}
static gboolean
-devkit_disks_device_create_filesystem_internal (DevkitDisksDevice *device,
+devkit_disks_device_filesystem_create_internal (DevkitDisksDevice *device,
const char *fstype,
char **options,
- CreateFilesystemHookFunc hook_func,
+ FilesystemCreateHookFunc hook_func,
gpointer hook_user_data,
DBusGMethodInvocation *context)
{
pk_caller,
argv,
passphrase_stdin,
- create_filesystem_create_encrypted_device_completed_cb,
+ filesystem_create_create_encrypted_device_completed_cb,
mkfse_data,
(GDestroyNotify) mkfse_data_unref)) {
goto out;
error = NULL;
if (!job_new (context,
- "CreateFilesystem",
+ "FilesystemCreate",
TRUE,
device,
pk_caller,
argv,
options_for_stdin,
- create_filesystem_completed_cb,
+ filesystem_create_completed_cb,
mkfs_data,
(GDestroyNotify) mkfs_data_unref)) {
goto out;
}
gboolean
-devkit_disks_device_create_filesystem (DevkitDisksDevice *device,
+devkit_disks_device_filesystem_create (DevkitDisksDevice *device,
const char *fstype,
char **options,
DBusGMethodInvocation *context)
{
- return devkit_disks_device_create_filesystem_internal (device, fstype, options, NULL, NULL, context);
+ return devkit_disks_device_filesystem_create_internal (device, fstype, options, NULL, NULL, context);
}
/*--------------------------------------------------------------------------------------------------------------*/
gboolean
-devkit_disks_device_cancel_job (DevkitDisksDevice *device,
+devkit_disks_device_job_cancel (DevkitDisksDevice *device,
DBusGMethodInvocation *context)
{
if (!device->priv->job_in_progress) {
} CreatePartitionData;
static CreatePartitionData *
-create_partition_data_new (DBusGMethodInvocation *context,
+partition_create_data_new (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
guint64 offset,
guint64 size,
}
static CreatePartitionData *
-create_partition_data_ref (CreatePartitionData *data)
+partition_create_data_ref (CreatePartitionData *data)
{
data->refcount++;
return data;
}
static void
-create_partition_data_unref (CreatePartitionData *data)
+partition_create_data_unref (CreatePartitionData *data)
{
data->refcount--;
if (data->refcount == 0) {
}
static void
-create_partition_create_filesystem_hook (DBusGMethodInvocation *context,
+partition_create_filesystem_create_hook (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
- gboolean create_filesystem_succeeded,
+ gboolean filesystem_create_succeeded,
gpointer user_data)
{
- if (!create_filesystem_succeeded) {
- /* dang.. CreateFilesystem already reported an error */
+ if (!filesystem_create_succeeded) {
+ /* dang.. FilesystemCreate already reported an error */
} else {
/* it worked.. */
dbus_g_method_return (context, device->priv->object_path);
}
static void
-create_partition_device_added_cb (DevkitDisksDaemon *daemon,
+partition_create_device_added_cb (DevkitDisksDaemon *daemon,
const char *object_path,
gpointer user_data)
{
/* yay! it is.. now create the file system if requested */
if (strlen (data->fstype) > 0) {
- devkit_disks_device_create_filesystem_internal (device,
+ devkit_disks_device_filesystem_create_internal (device,
data->fstype,
data->fsoptions,
- create_partition_create_filesystem_hook,
+ partition_create_filesystem_create_hook,
NULL,
data->context);
} else {
g_signal_handler_disconnect (daemon, data->device_added_signal_handler_id);
g_source_remove (data->device_added_timeout_id);
- create_partition_data_unref (data);
+ partition_create_data_unref (data);
}
}
static gboolean
-create_partition_device_not_seen_cb (gpointer user_data)
+partition_create_device_not_seen_cb (gpointer user_data)
{
CreatePartitionData *data = user_data;
"Error creating partition: timeout (10s) waiting for partition to show up");
g_signal_handler_disconnect (data->device->priv->daemon, data->device_added_signal_handler_id);
- create_partition_data_unref (data);
+ partition_create_data_unref (data);
return FALSE;
}
static void
-create_partition_completed_cb (DBusGMethodInvocation *context,
+partition_create_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
data->device_added_signal_handler_id = g_signal_connect_after (
device->priv->daemon,
"device-added",
- (GCallback) create_partition_device_added_cb,
- create_partition_data_ref (data));
+ (GCallback) partition_create_device_added_cb,
+ partition_create_data_ref (data));
/* set up timeout for error reporting if waiting failed
*
* as one will cancel the other)
*/
data->device_added_timeout_id = g_timeout_add (10 * 1000,
- create_partition_device_not_seen_cb,
+ partition_create_device_not_seen_cb,
data);
}
} else {
}
gboolean
-devkit_disks_device_create_partition (DevkitDisksDevice *device,
+devkit_disks_device_partition_create (DevkitDisksDevice *device,
guint64 offset,
guint64 size,
const char *type,
error = NULL;
if (!job_new (context,
- "CreatePartition",
+ "PartitionCreate",
TRUE,
device,
pk_caller,
argv,
NULL,
- create_partition_completed_cb,
- create_partition_data_new (context, device, offset, size, fstype, fsoptions),
- (GDestroyNotify) create_partition_data_unref)) {
+ partition_create_completed_cb,
+ partition_create_data_new (context, device, offset, size, fstype, fsoptions),
+ (GDestroyNotify) partition_create_data_unref)) {
goto out;
}
} ModifyPartitionData;
static ModifyPartitionData *
-modify_partition_data_new (DBusGMethodInvocation *context,
+partition_modify_data_new (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
DevkitDisksDevice *enclosing_device,
const char *type,
}
static void
-modify_partition_data_unref (ModifyPartitionData *data)
+partition_modify_data_unref (ModifyPartitionData *data)
{
g_object_unref (data->device);
g_object_unref (data->enclosing_device);
}
static void
-modify_partition_completed_cb (DBusGMethodInvocation *context,
+partition_modify_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_modify_partition (DevkitDisksDevice *device,
+devkit_disks_device_partition_modify (DevkitDisksDevice *device,
const char *type,
const char *label,
char **flags,
error = NULL;
if (!job_new (context,
- "ModifyPartition",
+ "PartitionModify",
TRUE,
device,
pk_caller,
argv,
NULL,
- modify_partition_completed_cb,
- modify_partition_data_new (context, device, enclosing_device, type, label, flags),
- (GDestroyNotify) modify_partition_data_unref)) {
+ partition_modify_completed_cb,
+ partition_modify_data_new (context, device, enclosing_device, type, label, flags),
+ (GDestroyNotify) partition_modify_data_unref)) {
goto out;
}
/*--------------------------------------------------------------------------------------------------------------*/
static void
-create_partition_table_completed_cb (DBusGMethodInvocation *context,
+partition_table_create_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_create_partition_table (DevkitDisksDevice *device,
+devkit_disks_device_partition_table_create (DevkitDisksDevice *device,
const char *scheme,
char **options,
DBusGMethodInvocation *context)
error = NULL;
if (!job_new (context,
- "CreatePartitionTable",
+ "PartitionTableCreate",
TRUE,
device,
pk_caller,
argv,
NULL,
- create_partition_table_completed_cb,
+ partition_table_create_completed_cb,
NULL,
NULL)) {
goto out;
static void
-unlock_encrypted_device_added_cb (DevkitDisksDaemon *daemon,
+encrypted_unlock_device_added_cb (DevkitDisksDaemon *daemon,
const char *object_path,
gpointer user_data)
{
}
static gboolean
-unlock_encrypted_device_not_seen_cb (gpointer user_data)
+encrypted_unlock_device_not_seen_cb (gpointer user_data)
{
UnlockEncryptionData *data = user_data;
}
static void
-unlock_encrypted_completed_cb (DBusGMethodInvocation *context,
+encrypted_unlock_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
data->device_added_signal_handler_id = g_signal_connect_after (
device->priv->daemon,
"device-added",
- (GCallback) unlock_encrypted_device_added_cb,
+ (GCallback) encrypted_unlock_device_added_cb,
unlock_encryption_data_ref (data));
/* set up timeout for error reporting if waiting failed
* as one will cancel the other)
*/
data->device_added_timeout_id = g_timeout_add (10 * 1000,
- unlock_encrypted_device_not_seen_cb,
+ encrypted_unlock_device_not_seen_cb,
data);
}
} else {
}
static gboolean
-devkit_disks_device_unlock_encrypted_internal (DevkitDisksDevice *device,
+devkit_disks_device_encrypted_unlock_internal (DevkitDisksDevice *device,
const char *secret,
char **options,
UnlockEncryptionHookFunc hook_func,
error = NULL;
if (!job_new (context,
- "UnlockEncrypted",
+ "EncryptedUnlock",
FALSE,
device,
pk_caller,
argv,
secret_as_stdin,
- unlock_encrypted_completed_cb,
+ encrypted_unlock_completed_cb,
unlock_encryption_data_new (context, device, hook_func, hook_user_data),
(GDestroyNotify) unlock_encryption_data_unref)) {
goto out;
}
gboolean
-devkit_disks_device_unlock_encrypted (DevkitDisksDevice *device,
+devkit_disks_device_encrypted_unlock (DevkitDisksDevice *device,
const char *secret,
char **options,
DBusGMethodInvocation *context)
{
- return devkit_disks_device_unlock_encrypted_internal (device, secret, options, NULL, NULL, context);
+ return devkit_disks_device_encrypted_unlock_internal (device, secret, options, NULL, NULL, context);
}
/*--------------------------------------------------------------------------------------------------------------*/
static void
-lock_encrypted_completed_cb (DBusGMethodInvocation *context,
+encrypted_lock_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_lock_encrypted (DevkitDisksDevice *device,
+devkit_disks_device_encrypted_lock (DevkitDisksDevice *device,
char **options,
DBusGMethodInvocation *context)
{
error = NULL;
if (!job_new (context,
- "LockEncrypted",
+ "EncryptedLock",
FALSE,
device,
pk_caller,
argv,
NULL,
- lock_encrypted_completed_cb,
+ encrypted_lock_completed_cb,
NULL,
NULL)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-change_secret_for_encrypted_completed_cb (DBusGMethodInvocation *context,
+encrypted_change_passphrase_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_change_secret_for_encrypted (DevkitDisksDevice *device,
+devkit_disks_device_encrypted_change_passphrase (DevkitDisksDevice *device,
const char *old_secret,
const char *new_secret,
DBusGMethodInvocation *context)
error = NULL;
if (!job_new (context,
- "ChangeSecretForEncrypted",
+ "EncryptedChangePassphrase",
FALSE,
device,
pk_caller,
argv,
secrets_as_stdin,
- change_secret_for_encrypted_completed_cb,
+ encrypted_change_passphrase_completed_cb,
NULL,
NULL)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-change_filesystem_label_completed_cb (DBusGMethodInvocation *context,
+filesystem_set_label_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_change_filesystem_label (DevkitDisksDevice *device,
+devkit_disks_device_filesystem_set_label (DevkitDisksDevice *device,
const char *new_label,
DBusGMethodInvocation *context)
{
error = NULL;
if (!job_new (context,
- "ChangeFilesystemLabel",
+ "FilesystemSetLabel",
FALSE,
device,
pk_caller,
argv,
NULL,
- change_filesystem_label_completed_cb,
+ filesystem_set_label_completed_cb,
g_strdup (new_label),
g_free)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-retrieve_smart_data_completed_cb (DBusGMethodInvocation *context,
+smart_retrieve_data_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_retrieve_smart_data (DevkitDisksDevice *device,
+devkit_disks_device_smart_retrieve_data (DevkitDisksDevice *device,
DBusGMethodInvocation *context)
{
int n;
error = NULL;
if (!job_new (context,
- "RetrieveSmartData",
+ "SmartRetrieveData",
FALSE,
device,
pk_caller,
argv,
NULL,
- retrieve_smart_data_completed_cb,
+ smart_retrieve_data_completed_cb,
NULL,
NULL)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-run_smart_selftest_completed_cb (DBusGMethodInvocation *context,
+smart_initiate_selftest_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_run_smart_selftest (DevkitDisksDevice *device,
+devkit_disks_device_smart_initiate_selftest (DevkitDisksDevice *device,
const char *test,
gboolean captive,
DBusGMethodInvocation *context)
error = NULL;
if (!job_new (context,
- "RunSmartSelftest",
+ "SmartInitiateSelftest",
TRUE,
device,
pk_caller,
argv,
NULL,
- run_smart_selftest_completed_cb,
+ smart_initiate_selftest_completed_cb,
NULL,
NULL)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-stop_linux_md_array_completed_cb (DBusGMethodInvocation *context,
+linux_md_stop_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_stop_linux_md_array (DevkitDisksDevice *device,
+devkit_disks_device_linux_md_stop (DevkitDisksDevice *device,
char **options,
DBusGMethodInvocation *context)
{
error = NULL;
if (!job_new (context,
- "StopLinuxMdArray",
+ "LinuxMdStop",
TRUE,
device,
pk_caller,
argv,
NULL,
- stop_linux_md_array_completed_cb,
+ linux_md_stop_completed_cb,
NULL,
NULL)) {
goto out;
/*--------------------------------------------------------------------------------------------------------------*/
static void
-add_component_to_linux_md_array_completed_cb (DBusGMethodInvocation *context,
+linux_md_add_component_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
}
gboolean
-devkit_disks_device_add_component_to_linux_md_array (DevkitDisksDevice *device,
+devkit_disks_device_linux_md_add_component (DevkitDisksDevice *device,
char *component,
char **options,
DBusGMethodInvocation *context)
error = NULL;
if (!job_new (context,
- "AddComponentToLinuxMdArray",
+ "LinuxMdAddComponent",
TRUE,
device,
pk_caller,
argv,
NULL,
- add_component_to_linux_md_array_completed_cb,
+ linux_md_add_component_completed_cb,
g_object_ref (slave),
g_object_unref)) {
goto out;
static void
-remove_component_from_linux_md_array_device_changed_cb (DevkitDisksDaemon *daemon,
+linux_md_remove_component_device_changed_cb (DevkitDisksDaemon *daemon,
const char *object_path,
gpointer user_data)
{
}
static gboolean
-remove_component_from_linux_md_array_device_not_seen_cb (gpointer user_data)
+linux_md_remove_component_device_not_seen_cb (gpointer user_data)
{
RemoveComponentData *data = user_data;
static void
-remove_component_from_linux_md_array_completed_cb (DBusGMethodInvocation *context,
+linux_md_remove_component_completed_cb (DBusGMethodInvocation *context,
DevkitDisksDevice *device,
PolKitCaller *pk_caller,
gboolean job_was_cancelled,
data->device_changed_signal_handler_id = g_signal_connect_after (
device->priv->daemon,
"device-changed",
- (GCallback) remove_component_from_linux_md_array_device_changed_cb,
+ (GCallback) linux_md_remove_component_device_changed_cb,
remove_component_data_ref (data));
/* set up timeout for error reporting if waiting failed
*/
data->device_changed_timeout_id = g_timeout_add (
10 * 1000,
- remove_component_from_linux_md_array_device_not_seen_cb,
+ linux_md_remove_component_device_not_seen_cb,
data);
} else {
}
gboolean
-devkit_disks_device_remove_component_from_linux_md_array (DevkitDisksDevice *device,
+devkit_disks_device_linux_md_remove_component (DevkitDisksDevice *device,
char *component,
char **options,
DBusGMethodInvocation *context)
error = NULL;
if (!job_new (context,
- "RemoveComponentFromLinuxMdArray",
+ "LinuxMdRemoveComponent",
TRUE,
device,
pk_caller,
argv,
NULL,
- remove_component_from_linux_md_array_completed_cb,
+ linux_md_remove_component_completed_cb,
remove_component_data_new (context, slave, options),
(GDestroyNotify) remove_component_data_unref)) {
goto out;
DevkitDisksDaemon *daemon;
char *uuid;
-} AssembleLinuxMdArrayData;
+} LinuxMdStartData;
-static AssembleLinuxMdArrayData *
-assemble_linux_md_array_data_new (DBusGMethodInvocation *context,
- DevkitDisksDaemon *daemon,
- const char *uuid)
+static LinuxMdStartData *
+linux_md_start_data_new (DBusGMethodInvocation *context,
+ DevkitDisksDaemon *daemon,
+ const char *uuid)
{
- AssembleLinuxMdArrayData *data;
+ LinuxMdStartData *data;
- data = g_new0 (AssembleLinuxMdArrayData, 1);
+ data = g_new0 (LinuxMdStartData, 1);
data->refcount = 1;
data->context = context;
return data;
}
-static AssembleLinuxMdArrayData *
-assemble_linux_md_array_data_ref (AssembleLinuxMdArrayData *data)
+static LinuxMdStartData *
+linux_md_start_data_ref (LinuxMdStartData *data)
{
data->refcount++;
return data;
}
static void
-assemble_linux_md_array_data_unref (AssembleLinuxMdArrayData *data)
+linux_md_start_data_unref (LinuxMdStartData *data)
{
data->refcount--;
if (data->refcount == 0) {
}
static void
-assemble_linux_md_array_device_added_cb (DevkitDisksDaemon *daemon,
- const char *object_path,
- gpointer user_data)
+linux_md_start_device_added_cb (DevkitDisksDaemon *daemon,
+ const char *object_path,
+ gpointer user_data)
{
- AssembleLinuxMdArrayData *data = user_data;
+ LinuxMdStartData *data = user_data;
DevkitDisksDevice *device;
/* check the device is the one we're looking for */
g_signal_handler_disconnect (daemon, data->device_added_signal_handler_id);
g_source_remove (data->device_added_timeout_id);
- assemble_linux_md_array_data_unref (data);
+ linux_md_start_data_unref (data);
}
}
static gboolean
-assemble_linux_md_array_device_not_seen_cb (gpointer user_data)
+linux_md_start_device_not_seen_cb (gpointer user_data)
{
- AssembleLinuxMdArrayData *data = user_data;
+ LinuxMdStartData *data = user_data;
throw_error (data->context,
DEVKIT_DISKS_DEVICE_ERROR_GENERAL,
"Error assembling array: timeout (10s) waiting for array to show up");
g_signal_handler_disconnect (data->daemon, data->device_added_signal_handler_id);
- assemble_linux_md_array_data_unref (data);
+ linux_md_start_data_unref (data);
return FALSE;
}
/* NOTE: This is job completion callback from a method on the daemon, not the device. */
static void
-assemble_linux_md_array_completed_cb (DBusGMethodInvocation *context,
- DevkitDisksDevice *device,
- PolKitCaller *pk_caller,
- gboolean job_was_cancelled,
- int status,
- const char *stderr,
- const char *stdout,
- gpointer user_data)
+linux_md_start_completed_cb (DBusGMethodInvocation *context,
+ DevkitDisksDevice *device,
+ PolKitCaller *pk_caller,
+ gboolean job_was_cancelled,
+ int status,
+ const char *stderr,
+ const char *stdout,
+ gpointer user_data)
{
- AssembleLinuxMdArrayData *data = user_data;
+ LinuxMdStartData *data = user_data;
if (WEXITSTATUS (status) == 0 && !job_was_cancelled) {
GList *l;
data->device_added_signal_handler_id = g_signal_connect_after (
data->daemon,
"device-added",
- (GCallback) assemble_linux_md_array_device_added_cb,
- assemble_linux_md_array_data_ref (data));
+ (GCallback) linux_md_start_device_added_cb,
+ linux_md_start_data_ref (data));
/* set up timeout for error reporting if waiting failed
*
* as one will cancel the other)
*/
data->device_added_timeout_id = g_timeout_add (10 * 1000,
- assemble_linux_md_array_device_not_seen_cb,
+ linux_md_start_device_not_seen_cb,
data);
}
/* NOTE: This is a method on the daemon, not the device. */
gboolean
-devkit_disks_daemon_assemble_linux_md_array (DevkitDisksDaemon *daemon,
- GPtrArray *components,
- char **options,
- DBusGMethodInvocation *context)
+devkit_disks_daemon_linux_md_start (DevkitDisksDaemon *daemon,
+ GPtrArray *components,
+ char **options,
+ DBusGMethodInvocation *context)
{
int n;
int m;
error = NULL;
if (!job_new (context,
- "AssembleLinuxMdArray",
+ "LinuxMdStart",
TRUE,
NULL,
pk_caller,
argv,
NULL,
- assemble_linux_md_array_completed_cb,
- assemble_linux_md_array_data_new (context, daemon, uuid),
- (GDestroyNotify) assemble_linux_md_array_data_unref)) {
+ linux_md_start_completed_cb,
+ linux_md_start_data_new (context, daemon, uuid),
+ (GDestroyNotify) linux_md_start_data_unref)) {
goto out;
}
<!-- ************************************************************ -->
- <method name="CancelJob">
+ <method name="JobCancel">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<doc:doc>
<!-- ************************************************************ -->
- <method name="CreatePartitionTable">
+ <method name="PartitionTableCreate">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="scheme" direction="in" type="s">
<doc:doc><doc:summary>
<!-- ************************************************************ -->
- <method name="DeletePartition">
+ <method name="PartitionDelete">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="options" direction="in" type="as">
<doc:doc><doc:summary>Supports the <doc:tt>erase=</doc:tt> option for erasing the contents of the device.</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="CreatePartition">
+ <method name="PartitionCreate">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="offset" direction="in" type="t">
<doc:doc><doc:summary>Where on the device to create the partition.</doc:summary></doc:doc>
<doc:doc><doc:summary>
The file system to create in new partition. Leave
blank to skip creating a file system. See the
- <doc:ref type="method" to="Device.CreateFilesystem">CreateFilesystem()</doc:ref> method
+ <doc:ref type="method" to="Device.FilesystemCreate">FilesystemCreate()</doc:ref> method
for details.
</doc:summary></doc:doc>
</arg>
<arg name="fsoptions" direction="in" type="as">
<doc:doc><doc:summary>
Options to use for file system creation. See the
- <doc:ref type="method" to="Device.CreateFilesystem">CreateFilesystem()</doc:ref> method
+ <doc:ref type="method" to="Device.FilesystemCreate">FilesystemCreate()</doc:ref> method
for details.
</doc:summary></doc:doc>
</arg>
<!-- ************************************************************ -->
- <method name="ModifyPartition">
+ <method name="PartitionModify">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="type" direction="in" type="s">
<doc:doc><doc:summary>
The type of the partition to create. See the <doc:tt>type</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on valid types.
</doc:summary></doc:doc>
</arg>
<arg name="label" direction="in" type="s">
<doc:doc><doc:summary>
The label to use for the partition. See the <doc:tt>label</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on valid labels.
</doc:summary></doc:doc>
</arg>
<arg name="flags" direction="in" type="as">
<doc:doc><doc:summary>
Flags to use for the partition. See the <doc:tt>flags</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on valid flags
</doc:summary></doc:doc>
</arg>
<!-- ************************************************************ -->
- <method name="CreateFilesystem">
+ <method name="FilesystemCreate">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="fstype" direction="in" type="s">
<doc:doc><doc:summary>
<!-- ************************************************************ -->
- <method name="ChangeFilesystemLabel">
+ <method name="FilesystemSetLabel">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="new_label" direction="in" type="s">
<doc:doc><doc:summary>
<doc:para>
Changes the file system label. See the <doc:tt>options</doc:tt> parameter of
<doc:ref type="method"
- to="Device.CreateFilesystem">CreateFilesystem()</doc:ref>
+ to="Device.FilesystemCreate">FilesystemCreate()</doc:ref>
method for details of what valid labels are valid.
</doc:para>
</doc:description>
<!-- ************************************************************ -->
- <method name="Mount">
+ <method name="FilesystemMount">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="filesystem_type" direction="in" type="s">
<doc:doc><doc:summary>File system type to use.</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="Unmount">
+ <method name="FilesystemUnmount">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="options" direction="in" type="as">
<doc:doc><doc:summary>Unmount options. Valid options currently include only 'force'.</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="UnlockEncrypted">
+ <method name="EncryptedUnlock">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="secret" direction="in" type="s">
- <doc:doc><doc:summary>Secret for unlocking the cleartext data.</doc:summary></doc:doc>
+ <arg name="passphrase" direction="in" type="s">
+ <doc:doc><doc:summary>Passphrase for unlocking the cleartext data.</doc:summary></doc:doc>
</arg>
<arg name="options" direction="in" type="as">
<doc:doc><doc:summary>Currently unused.</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="LockEncrypted">
+ <method name="EncryptedLock">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="options" direction="in" type="as">
<doc:doc><doc:summary>Currently unused.</doc:summary></doc:doc>
<doc:para>
Tears down the cleartext device set up using
e.g. the <doc:ref type="method"
- to="Device.UnlockEncrypted">UnlockEncrypted()</doc:ref>
+ to="Device.EncryptedUnlock">EncryptedUnlock()</doc:ref>
method.
</doc:para>
</doc:description>
<!-- ************************************************************ -->
- <method name="ChangeSecretForEncrypted">
+ <method name="EncryptedChangePassphrase">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="current_secret" direction="in" type="s">
- <doc:doc><doc:summary>The current secret.</doc:summary></doc:doc>
+ <arg name="current_passphrase" direction="in" type="s">
+ <doc:doc><doc:summary>The current passphrase.</doc:summary></doc:doc>
</arg>
- <arg name="new_secret" direction="in" type="s">
- <doc:doc><doc:summary>The new secret.</doc:summary></doc:doc>
+ <arg name="new_passphrase" direction="in" type="s">
+ <doc:doc><doc:summary>The new passphrase.</doc:summary></doc:doc>
</arg>
<doc:doc>
<doc:description>
<doc:para>
- Change the secret used to unlock an encrypted device.
+ Change the passphrase used to unlock an encrypted device.
</doc:para>
</doc:description>
<doc:errors>
<!-- ************************************************************ -->
- <method name="Erase">
- <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg name="options" direction="in" type="as">
- <doc:doc><doc:summary>Supports the <doc:tt>erase=</doc:tt> option for erasing the contents of the device.</doc:summary></doc:doc>
- </arg>
-
- <doc:doc>
- <doc:description>
- <doc:para>
- Erase the contents of the device.
- </doc:para>
- </doc:description>
- <doc:errors>
- <doc:error name="&ERROR_IS_BUSY;">if the device is busy</doc:error>
- <doc:error name="&ERROR_GENERAL;">if incoming parameters are invalid or an unknown error occured</doc:error>
- <doc:error name="&ERROR_JOB_WAS_CANCELLED;">if the job was cancelled</doc:error>
- </doc:errors>
- </doc:doc>
- </method>
-
- <!-- ************************************************************ -->
-
- <method name="AddComponentToLinuxMdArray">
+ <method name="LinuxMdAddComponent">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="component" direction="in" type="o">
<doc:doc><doc:summary>Object path of the component to add</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="RemoveComponentFromLinuxMdArray">
+ <method name="LinuxMdRemoveComponent">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="component" direction="in" type="o">
<doc:doc><doc:summary>The component to remove from the array.</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="StopLinuxMdArray">
+ <method name="LinuxMdStop">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="options" direction="in" type="as">
<doc:doc><doc:summary>Currently unused.</doc:summary></doc:doc>
<!-- ************************************************************ -->
- <method name="RetrieveSmartData">
+ <method name="SmartRetrieveData">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="is_healthy" direction="out" type="b">
<!-- ************************************************************ -->
- <method name="RunSmartSelftest">
+ <method name="SmartInitiateSelftest">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="test" direction="in" type="s">
The 'job-id' property is used to identify the job and maps
1-1 with the names of the method calls on this interface,
- e.g. 'Erase', 'CreateFilesystem' and so on.
+ e.g. 'Erase', 'FilesystemCreate' and so on.
Note that the 'job-cur-task' percentage starts at 0. The
percentage is normally a number between 0 and 100. If set to -1
<doc:doc><doc:description><doc:para>
This property is used to identify the job and maps 1-1
with the names of the method calls on this interface,
- e.g. 'Erase', 'CreateFilesystem' and so on.
+ e.g. 'Erase', 'FilesystemCreate' and so on.
</doc:para></doc:description></doc:doc>
</property>
<property name="job-is-cancellable" type="b" access="read">
<doc:doc><doc:description><doc:para>
Whether the job can be cancelled
using <doc:ref type="method"
- to="Device.CancelJob">CancelJob()</doc:ref> method.
+ to="Device.JobCancel">JobCancel()</doc:ref> method.
</doc:para></doc:description></doc:doc>
</property>
<property name="job-num-tasks" type="i" access="read">
<doc:doc><doc:description><doc:para>
The scheme of the partition table this partition is part of.
See the <doc:tt>scheme</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartitionTable">CreatePartitionTable()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionTableCreate">PartitionTableCreate()</doc:ref> method
for details on known partitioning schemes.
This property is only valid if
<doc:ref type="property" to="Device:device-is-partition">device-is-partition</doc:ref>
<doc:doc><doc:description><doc:para>
The type of the partition.
See the <doc:tt>type</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on known partitioning types.
This property is only valid if
<doc:ref type="property" to="Device:device-is-partition">device-is-partition</doc:ref>
<doc:doc><doc:description><doc:para>
The label of the partition.
See the <doc:tt>label</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on partition labels.
This property is only valid if
<doc:ref type="property" to="Device:device-is-partition">device-is-partition</doc:ref>
<doc:doc><doc:description><doc:para>
The UUID of the partition.
See the <doc:tt>uuid</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on partition UUID's.
This property is only valid if
<doc:ref type="property" to="Device:device-is-partition">device-is-partition</doc:ref>
<doc:doc><doc:description><doc:para>
Partition flags.
See the <doc:tt>flags</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartition">CreatePartition()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionCreate">PartitionCreate()</doc:ref> method
for details on partition flags.
This property is only valid if
<doc:ref type="property" to="Device:device-is-partition">device-is-partition</doc:ref>
<doc:doc><doc:description><doc:para>
The scheme of the partition table.
See the <doc:tt>scheme</doc:tt> parameter of the
- <doc:ref type="method" to="Device.CreatePartitionTable">CreatePartitionTable()</doc:ref> method
+ <doc:ref type="method" to="Device.PartitionTableCreate">PartitionTableCreate()</doc:ref> method
for details on known partitioning schemes.
This property is only valid if
<doc:ref type="property" to="Device:device-is-partition-table">device-is-partition-table</doc:ref>