revert "rename FilesystemSetLabel to SetLabel; some non-fs devices supports labels...
authorDavid Zeuthen <davidz@redhat.com>
Thu, 5 Jun 2008 21:22:36 +0000 (17:22 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Thu, 5 Jun 2008 21:22:36 +0000 (17:22 -0400)
This reverts commit f7ad692c880c44dd9d52844f9963e08e24ec92cf.

Hmm.. thinking about it, it's probably better to have SwapSetLabel(),
LinuxMdSetLabel() and so forth.

src/devkit-disks-device.c
src/devkit-disks-device.h
src/org.freedesktop.DeviceKit.Disks.Device.xml

index 6b8b3fd..b9203fd 100644 (file)
@@ -5611,7 +5611,7 @@ out:
 /*--------------------------------------------------------------------------------------------------------------*/
 
 static void
-set_label_completed_cb (DBusGMethodInvocation *context,
+filesystem_set_label_completed_cb (DBusGMethodInvocation *context,
                                       DevkitDisksDevice *device,
                                       PolKitCaller *pk_caller,
                                       gboolean job_was_cancelled,
@@ -5650,7 +5650,7 @@ set_label_completed_cb (DBusGMethodInvocation *context,
 }
 
 gboolean
-devkit_disks_device_set_label (DevkitDisksDevice     *device,
+devkit_disks_device_filesystem_set_label (DevkitDisksDevice     *device,
                                              const char            *new_label,
                                              DBusGMethodInvocation *context)
 {
@@ -5699,13 +5699,13 @@ devkit_disks_device_set_label (DevkitDisksDevice     *device,
 
         error = NULL;
         if (!job_new (context,
-                      "SetLabel",
+                      "FilesystemSetLabel",
                       FALSE,
                       device,
                       pk_caller,
                       argv,
                       NULL,
-                      set_label_completed_cb,
+                      filesystem_set_label_completed_cb,
                       g_strdup (new_label),
                       g_free)) {
                 goto out;
index 71faf20..49cad70 100644 (file)
@@ -146,9 +146,9 @@ gboolean devkit_disks_device_luks_change_passphrase (DevkitDisksDevice     *devi
                                                      const char            *new_secret,
                                                      DBusGMethodInvocation *context);
 
-gboolean devkit_disks_device_set_label (DevkitDisksDevice     *device,
-                                        const char            *new_label,
-                                        DBusGMethodInvocation *context);
+gboolean devkit_disks_device_filesystem_set_label (DevkitDisksDevice     *device,
+                                                   const char            *new_label,
+                                                   DBusGMethodInvocation *context);
 
 gboolean devkit_disks_device_drive_smart_refresh_data (DevkitDisksDevice     *device,
                                                        char                 **options,
index 3c96a00..e305614 100644 (file)
 
     <!-- ************************************************************ -->
 
-    <method name="SetLabel">
+    <method name="FilesystemCreate">
       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
-      <arg name="new_label" direction="in" type="s">
+      <arg name="fstype" direction="in" type="s">
         <doc:doc><doc:summary>
-            New label for device
+            The type of file system to
+            create. Pass <doc:tt>empty</doc:tt> to not create a file
+            system and just clear the areas of the device known to host
+            file system signatures. Use @TODO@ to get a list of file systems that can
+            be created.
+        </doc:summary></doc:doc>
+      </arg>
+      <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. To set the
+            label use <doc:tt>label=NAME</doc:tt>. Labels may not be supported
+            for all file systems and the allowed length of a label may vary (see @TODO@).
+            To create the file system on an LUKS encrypted
+            block device, pass the <doc:tt>luks_encrypt=</doc:tt> option with the
+            value set to the passphrase to use. For file systems with the concept of owners (e.g.
+            <doc:tt>ext3</doc:tt>), the options <doc:tt>take_ownership_uid=</doc:tt> and
+            <doc:tt>take_ownership_gid=</doc:tt> are supported and can be used to set the
+            initial owner of the created file system.
         </doc:summary></doc:doc>
       </arg>
 
       <doc:doc>
         <doc:description>
           <doc:para>
-            Changes the label on the device; note that this depends on the
-            the type/contents of the device; see the properties
-            <doc:ref type="property" to="Device:id-usage">id-usage</doc:ref>.
-            <doc:ref type="property" to="Device:id-type">id-type</doc:ref> and
-            <doc:ref type="property" to="Device:id-version">id-version</doc:ref>
-            for details. Most file systems supports labels; other known
-            device types that supports labels include Linux swap space
-            version 2. @TODO@ lists the file systems that supports
-            labels.
+            Create a file system on a device. If
+            the <doc:tt>luks_encrypt=</doc:tt> option is passed then an
+            LUKS encrypted block device will be created, then unlocked and
+            the file system will be created on the corresponding
+            cleartext device.
           </doc:para>
         </doc:description>
         <doc:permission>
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_BUSY;">if the device is busy and changing the label requires e.g. an unmounted file system</doc:error>
+          <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
           <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
-          <doc:error name="&ERROR_NOT_LABELED;">if the device type doesn't support labels</doc:error>
         </doc:errors>
       </doc:doc>
     </method>
 
     <!-- ************************************************************ -->
 
-    <method name="FilesystemCreate">
+    <method name="FilesystemSetLabel">
       <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
-      <arg name="fstype" direction="in" type="s">
+      <arg name="new_label" direction="in" type="s">
         <doc:doc><doc:summary>
-            The type of file system to
-            create. Pass <doc:tt>empty</doc:tt> to not create a file
-            system and just clear the areas of the device known to host
-            file system signatures. Use @TODO@ to get a list of file systems that can
-            be created.
-        </doc:summary></doc:doc>
-      </arg>
-      <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. To set the
-            label use <doc:tt>label=NAME</doc:tt>. Labels may not be supported
-            for all file systems and the allowed length of a label may vary (see @TODO@).
-            To create the file system on an LUKS encrypted
-            block device, pass the <doc:tt>luks_encrypt=</doc:tt> option with the
-            value set to the passphrase to use. For file systems with the concept of owners (e.g.
-            <doc:tt>ext3</doc:tt>), the options <doc:tt>take_ownership_uid=</doc:tt> and
-            <doc:tt>take_ownership_gid=</doc:tt> are supported and can be used to set the
-            initial owner of the created file system.
+            New label for file system.
         </doc:summary></doc:doc>
       </arg>
 
       <doc:doc>
         <doc:description>
           <doc:para>
-            Create a file system on a device. If
-            the <doc:tt>luks_encrypt=</doc:tt> option is passed then an
-            LUKS encrypted block device will be created, then unlocked and
-            the file system will be created on the corresponding
-            cleartext device.
+            Changes the file system label. See the <doc:tt>options</doc:tt> parameter of
+            <doc:ref type="method"
+            to="Device.FilesystemCreate">FilesystemCreate()</doc:ref>
+            method for details of what valid labels are valid.
           </doc:para>
         </doc:description>
         <doc:permission>
         </doc:permission>
         <doc:errors>
           <doc:error name="&ERROR_NOT_AUTHORIZED;">if the caller lacks the appropriate PolicyKit authorization</doc:error>
-          <doc:error name="&ERROR_BUSY;">if the device is busy</doc:error>
+          <doc:error name="&ERROR_BUSY;">if the device is busy and changing the label requires an unmounted file system</doc:error>
           <doc:error name="&ERROR_FAILED;">if incoming parameters are invalid or an unknown error occured</doc:error>
           <doc:error name="&ERROR_CANCELLED;">if the job was cancelled</doc:error>
+          <doc:error name="&ERROR_NOT_LABELED;">if the contents of the device doesn't support labels</doc:error>
         </doc:errors>
       </doc:doc>
     </method>