make Device.is_busy() and Davice.partitions_are_busy() methods private
authorDavid Zeuthen <davidz@redhat.com>
Sun, 1 Mar 2009 15:47:46 +0000 (10:47 -0500)
committerDavid Zeuthen <davidz@redhat.com>
Sun, 1 Mar 2009 15:47:46 +0000 (10:47 -0500)
src/devkit-disks-device.c
src/devkit-disks-device.h

index 1d509d7..804c6c4 100644 (file)
@@ -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,
index 43d1b9c..6470580 100644 (file)
@@ -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,