From 7e5fe867095af6244cb904b9dbe43298ab2f534d Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sun, 1 Mar 2009 10:47:46 -0500 Subject: [PATCH] make Device.is_busy() and Davice.partitions_are_busy() methods private --- src/devkit-disks-device.c | 65 +++++++++++++++++++++++++---------------------- src/devkit-disks-device.h | 3 --- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c index 1d509d7..804c6c4 100644 --- a/src/devkit-disks-device.c +++ b/src/devkit-disks-device.c @@ -75,6 +75,9 @@ static gboolean update_info (DevkitDisksDevice *device); static void drain_pending_changes (DevkitDisksDevice *device, gboolean force_update); +static gboolean devkit_disks_device_local_is_busy (DevkitDisksDevice *device); +static gboolean devkit_disks_device_local_partitions_are_busy (DevkitDisksDevice *device); + static gboolean luks_get_uid_from_dm_name (const char *dm_name, uid_t *out_uid); @@ -3027,7 +3030,7 @@ out: return ret; } -gboolean +static gboolean devkit_disks_device_local_is_busy (DevkitDisksDevice *device) { gboolean ret; @@ -3052,6 +3055,36 @@ out: return ret; } +/* note: this only checks whether the actual partitions are busy; + * caller will need to check the main device itself too + */ +static gboolean +devkit_disks_device_local_partitions_are_busy (DevkitDisksDevice *device) +{ + gboolean ret; + GList *l; + GList *devices; + + ret = FALSE; + + devices = devkit_disks_daemon_local_get_all_devices (device->priv->daemon); + for (l = devices; l != NULL; l = l->next) { + DevkitDisksDevice *d = DEVKIT_DISKS_DEVICE (l->data); + + if (d->priv->device_is_partition && + d->priv->partition_slave != NULL && + strcmp (d->priv->partition_slave, device->priv->object_path) == 0) { + + if (devkit_disks_device_local_is_busy (d)) { + ret = TRUE; + break; + } + } + } + + return ret; +} + void devkit_disks_device_removed (DevkitDisksDevice *device) { @@ -6013,36 +6046,6 @@ partition_table_create_completed_cb (DBusGMethodInvocation *context, } } -/* note: this only checks whether the actual partitions are busy; - * caller will need to check the main device itself too - */ -gboolean -devkit_disks_device_local_partitions_are_busy (DevkitDisksDevice *device) -{ - gboolean ret; - GList *l; - GList *devices; - - ret = FALSE; - - devices = devkit_disks_daemon_local_get_all_devices (device->priv->daemon); - for (l = devices; l != NULL; l = l->next) { - DevkitDisksDevice *d = DEVKIT_DISKS_DEVICE (l->data); - - if (d->priv->device_is_partition && - d->priv->partition_slave != NULL && - strcmp (d->priv->partition_slave, device->priv->object_path) == 0) { - - if (devkit_disks_device_local_is_busy (d)) { - ret = TRUE; - break; - } - } - } - - return ret; -} - gboolean devkit_disks_device_partition_table_create (DevkitDisksDevice *device, const char *scheme, diff --git a/src/devkit-disks-device.h b/src/devkit-disks-device.h index 43d1b9c..6470580 100644 --- a/src/devkit-disks-device.h +++ b/src/devkit-disks-device.h @@ -69,9 +69,6 @@ const char *devkit_disks_device_local_get_native_path (DevkitDisksDev const char *devkit_disks_device_local_get_device_file (DevkitDisksDevice *device); const char *devkit_disks_device_local_get_mount_path (DevkitDisksDevice *device); -gboolean devkit_disks_device_local_is_busy (DevkitDisksDevice *device); -gboolean devkit_disks_device_local_partitions_are_busy (DevkitDisksDevice *device); - /* exported methods */ gboolean devkit_disks_device_job_cancel (DevkitDisksDevice *device, -- 2.7.4