LoopSetup:
@fd: An index for the file descriptor to use.
@options: Options - known options (in addition to <link linkend="udisks-std-options">standard options</link>) includes <parameter>offset</parameter> (of type 't'), <parameter>size</parameter> (of type 't') and <parameter>read-only</parameter> (of type 'b').
- @resulting_device: An object path to the object implementing the #org.freedesktop.UDisks2.BlockDevice interface.
+ @resulting_device: An object path to the object implementing the #org.freedesktop.UDisks2.Block interface.
Creates a block device for the file represented by @fd.
-->
removable media.
This interface should not to be confused with the
- #org.freedesktop.UDisks2.BlockDevice interface that is used for
- any low-level block devices the OS knows about. For example, if
+ #org.freedesktop.UDisks2.Block interface that is used for
+ low-level block devices the OS knows about. For example, if
<filename>/dev/sda</filename> and <filename>/dev/sdb</filename>
are block devices for two paths to the same drive, there will be
only one #org.freedesktop.UDisks2.Drive object but two
- #org.freedesktop.UDisks2.BlockDevice objects.
+ #org.freedesktop.UDisks2.Block objects.
-->
<interface name="org.freedesktop.UDisks2.Drive">
<!-- Vendor: A name for the vendor of the drive or blank if unknown. -->
<!-- ********************************************************************** -->
<!--
- org.freedesktop.UDisks2.BlockDevice:
+ org.freedesktop.UDisks2.Block:
@short_description: Low-level Block Device
This interface represents a block device.
- This should not be confused with the #org.freedesktop.UDisks2.Drive
- interface that is used to represent disk drives. For example, the
- #org.freedesktop.UDisks2.BlockDevice interface is also used for
- block devices that do not correspond to drives at all (e.g. <ulink
+ This should not be confused with the
+ #org.freedesktop.UDisks2.Drive interface that is used to represent
+ disk drives. For example, the #org.freedesktop.UDisks2.Block
+ interface is also used for block devices that do not correspond to
+ drives at all (e.g. <ulink
url="http://en.wikipedia.org/wiki/Loop_device">Loop
Devices</ulink>).
-->
- <interface name="org.freedesktop.UDisks2.BlockDevice">
+ <interface name="org.freedesktop.UDisks2.Block">
<!-- Device: The special device file for the block device e.g. <filename>/dev/sda2</filename>. -->
<property name="Device" type="ay" access="read"/>
<!-- Symlinks:
Known symlinks in <filename>/dev</filename> that points to
the device file in the
- #org.freedesktop.UDisks2.BlockDevice:Device property.
+ #org.freedesktop.UDisks2.Block:Device property.
For example, this array could include symlinks such as
<filename>/dev/disk/by-id/ata-INTEL_SSDSA2MH080G1GC_CVEM842101HD080DGN</filename>
<!-- PreferredDevice:
The special device file to present in the UI instead of the value
- of the #org.freedesktop.UDisks2.BlockDevice:Device property.
+ of the #org.freedesktop.UDisks2.Block:Device property.
For example this could be
e.g. <filename>/dev/mapper/mpathk</filename> for a multipath
IdType:
This property contains more information about the result of
probing the block device. Its value depends of the value the
- #org.freedesktop.UDisks2.BlockDevice:IdUsage property:
+ #org.freedesktop.UDisks2.Block:IdUsage property:
<variablelist>
<varlistentry><term>filesystem</term>
<listitem><para>The mountable file system that was detected (e.g. <literal>vfat</literal>).</para></listitem>
actual configuration data.
Use the
- org.freedesktop.UDisks2.BlockDevice.AddConfigurationItem(),
- org.freedesktop.UDisks2.BlockDevice.RemoveConfigurationItem()
+ org.freedesktop.UDisks2.Block.AddConfigurationItem(),
+ org.freedesktop.UDisks2.Block.RemoveConfigurationItem()
and
- org.freedesktop.UDisks2.BlockDevice.UpdateConfigurationItem()
+ org.freedesktop.UDisks2.Block.UpdateConfigurationItem()
methods to add, remove and update configuration items.
Use
- org.freedesktop.UDisks2.BlockDevice.GetSecretConfiguration()
+ org.freedesktop.UDisks2.Block.GetSecretConfiguration()
to get the secrets (e.g. passphrases) that may be part of the
configuration but isn't exported in this property for
security reasons.
<varlistentry>
<term>passphrase-contents (type <literal>'ay'</literal>)</term>
<listitem><para>The contents of the file containing the encryption password, if applicable.
- This is only available via the org.freedesktop.UDisks2.BlockDevice.GetSecretConfiguration()
+ This is only available via the org.freedesktop.UDisks2.Block.GetSecretConfiguration()
method.</para></listitem>
</varlistentry>
<varlistentry>
</variablelist>
For security reasons, when creating a new
<literal>crypttab</literal> entry (via the
- org.freedesktop.UDisks2.BlockDevice.AddConfigurationItem()
+ org.freedesktop.UDisks2.Block.AddConfigurationItem()
method), then the <option>passphrase-path</option> must
reference an unexisting file in the
<filename>/etc/luks-keys</filename> directory.
<property name="Configuration" type="a(sa{sv})" access="read"/>
<!-- CryptoBackingDevice:
- The #org.freedesktop.UDisks2.BlockDevice object that is
+ The #org.freedesktop.UDisks2.Block object that is
backing the device or <literal>/</literal> if unknown or if
the block device is not the cleartext device for an encrypted
device.
<ulink
url="http://en.wikipedia.org/wiki/Apple_Partition_Map">Apple
Partition Map</ulink>). If blank, and
- #org.freedesktop.UDisks2.BlockDevice:PartTable is %TRUE, a
+ #org.freedesktop.UDisks2.Block:PartTable is %TRUE, a
partition table was detected but its scheme is unknown.
-->
<property name="PartTableScheme" type="s" access="read"/>
<!-- PartEntryNumber: The number of the partition in the partition table. -->
<property name="PartEntryNumber" type="u" access="read"/>
<!-- PartEntryScheme: The partition table scheme or blank if unknown.
- See the #org.freedesktop.UDisks2.BlockDevice:PartTable property for known schemes.
+ See the #org.freedesktop.UDisks2.Block:PartTable property for known schemes.
-->
<property name="PartEntryScheme" type="s" access="read"/>
<!-- PartEntryType: The type of the partition. -->
<!-- PartEntryUUID: The UUID of the partition or blank if not supported or unknown. -->
<property name="PartEntryUUID" type="ay" access="read"/>
<!-- PartEntryTable:
- The object path of the #org.freedesktop.UDisks2.BlockDevice
+ The object path of the #org.freedesktop.UDisks2.Block
partition table that the partition entry belongs to or
<literal>/</literal> if the device is not a partition.
-->
Adds a new configuration item.
- See the #org.freedesktop.UDisks2.BlockDevice:Configuration
+ See the #org.freedesktop.UDisks2.Block:Configuration
property for details about valid configuration items.
-->
<method name="AddConfigurationItem">
Removes an existing configuration item.
- See the #org.freedesktop.UDisks2.BlockDevice:Configuration
+ See the #org.freedesktop.UDisks2.Block:Configuration
property for details about valid configuration items.
-->
<method name="RemoveConfigurationItem">
Removes a configuration item and adds a new one. This is
equivalent to calling
- org.freedesktop.UDisks2.BlockDevice.RemoveConfigurationItem()
+ org.freedesktop.UDisks2.Block.RemoveConfigurationItem()
followed by
- org.freedesktop.UDisks2.BlockDevice.AddConfigurationItem()
+ org.freedesktop.UDisks2.Block.AddConfigurationItem()
with the change that only one PolicyKit check is made
and that @new_item can be validated against @old_item.
- See the #org.freedesktop.UDisks2.BlockDevice:Configuration
+ See the #org.freedesktop.UDisks2.Block:Configuration
property for details about valid configuration items.
-->
<method name="UpdateConfigurationItem">
@configuration: The resulting configuration.
Returns the same value as in the
- #org.freedesktop.UDisks2.BlockDevice:Configuration property
+ #org.freedesktop.UDisks2.Block:Configuration property
but without secret information filtered out.
-->
<method name="GetSecretConfiguration">
org.freedesktop.UDisks2.Filesystem:
@short_description: Block device containing a mountable filesystem
- This interface is used for #org.freedesktop.UDisks2.BlockDevice
+ This interface is used for #org.freedesktop.UDisks2.Block
devices that contain a mountable filesystem.
-->
<interface name="org.freedesktop.UDisks2.Filesystem">
- <!-- prereq: org.freedesktop.UDisks2.BlockDevice -->
+ <!-- prereq: org.freedesktop.UDisks2.Block -->
<!--
SetLabel:
org.freedesktop.UDisks2.Swapspace:
@short_description: Block device containing swap data
- This interface is used for #org.freedesktop.UDisks2.BlockDevice
+ This interface is used for #org.freedesktop.UDisks2.Block
devices that contain swap space.
-->
<interface name="org.freedesktop.UDisks2.Swapspace">
- <!-- prereq: org.freedesktop.UDisks2.BlockDevice -->
+ <!-- prereq: org.freedesktop.UDisks2.Block -->
<!-- Active: Set to %TRUE if the device is currently in use by the OS. -->
<property name="Active" type="b" access="read"/>
org.freedesktop.UDisks2.Encrypted:
@short_description: Block device containing encrypted data
- This interface is used for #org.freedesktop.UDisks2.BlockDevice
+ This interface is used for #org.freedesktop.UDisks2.Block
devices that contain encrypted data.
-->
<interface name="org.freedesktop.UDisks2.Encrypted">
- <!-- prereq: org.freedesktop.UDisks2.BlockDevice -->
+ <!-- prereq: org.freedesktop.UDisks2.Block -->
<!--
Unlock:
@passphrase: The passphrase to use.
@options: Options (currently unused except for <link linkend="udisks-std-options">standard options</link>).
- @cleartext_device: An object path to the unlocked object implementing the #org.freedesktop.UDisks2.BlockDevice interface.
+ @cleartext_device: An object path to the unlocked object implementing the #org.freedesktop.UDisks2.Block interface.
Tries to unlock the encrypted device using @passphrase.
org.freedesktop.UDisks2.Loop:
@short_description: Block device backed by a file
- This interface is used for #org.freedesktop.UDisks2.BlockDevice
+ This interface is used for #org.freedesktop.UDisks2.Block
devices that are loop devices.
-->
<interface name="org.freedesktop.UDisks2.Loop">
- <!-- prereq: org.freedesktop.UDisks2.BlockDevice -->
+ <!-- prereq: org.freedesktop.UDisks2.Block -->
<!--
Delete:
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Manager.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Drive.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Drive.Ata.xml"/>
- <xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.BlockDevice.xml"/>
+ <xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Block.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Filesystem.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Swapspace.xml"/>
<xi:include href="../udisks/udisks-generated-doc-org.freedesktop.UDisks2.Encrypted.xml"/>
<xi:include href="xml/UDisksDrive.xml"/>
<xi:include href="xml/UDisksDriveAta.xml"/>
<xi:include href="xml/UDisksJob.xml"/>
- <xi:include href="xml/UDisksBlockDevice.xml"/>
+ <xi:include href="xml/UDisksBlock.xml"/>
<xi:include href="xml/UDisksFilesystem.xml"/>
<xi:include href="xml/UDisksSwapspace.xml"/>
<xi:include href="xml/UDisksEncrypted.xml"/>
UDisksDaemonWaitFunc
udisks_daemon_wait_for_object_sync
udisks_daemon_find_object
-udisks_daemon_find_block_device
+udisks_daemon_find_block
udisks_daemon_launch_simple_job
udisks_daemon_launch_spawned_job
udisks_daemon_launch_spawned_job_sync
<TITLE>UDisksObject</TITLE>
UDisksObject
UDisksObjectIface
-udisks_object_get_block_device
+udisks_object_get_block
udisks_object_get_drive
udisks_object_get_drive_ata
udisks_object_get_filesystem
udisks_object_get_encrypted
udisks_object_get_loop
udisks_object_get_manager
-udisks_object_peek_block_device
+udisks_object_peek_block
udisks_object_peek_drive
udisks_object_peek_drive_ata
udisks_object_peek_filesystem
UDisksObjectSkeleton
UDisksObjectSkeletonClass
udisks_object_skeleton_new
-udisks_object_skeleton_set_block_device
+udisks_object_skeleton_set_block
udisks_object_skeleton_set_drive
udisks_object_skeleton_set_drive_ata
udisks_object_skeleton_set_filesystem
</SECTION>
<SECTION>
-<FILE>UDisksBlockDevice</FILE>
-UDisksBlockDevice
-UDisksBlockDeviceIface
-udisks_block_device_interface_info
-udisks_block_device_override_properties
-udisks_block_device_call_get_secret_configuration
-udisks_block_device_call_get_secret_configuration_finish
-udisks_block_device_call_get_secret_configuration_sync
-udisks_block_device_complete_get_secret_configuration
-udisks_block_device_call_add_configuration_item
-udisks_block_device_call_add_configuration_item_finish
-udisks_block_device_call_add_configuration_item_sync
-udisks_block_device_complete_add_configuration_item
-udisks_block_device_call_remove_configuration_item
-udisks_block_device_call_remove_configuration_item_finish
-udisks_block_device_call_remove_configuration_item_sync
-udisks_block_device_complete_remove_configuration_item
-udisks_block_device_call_update_configuration_item
-udisks_block_device_call_update_configuration_item_finish
-udisks_block_device_call_update_configuration_item_sync
-udisks_block_device_complete_update_configuration_item
-udisks_block_device_get_configuration
-udisks_block_device_get_crypto_backing_device
-udisks_block_device_get_device
-udisks_block_device_get_drive
-udisks_block_device_get_id_label
-udisks_block_device_get_id_type
-udisks_block_device_get_id_usage
-udisks_block_device_get_id_uuid
-udisks_block_device_get_id_version
-udisks_block_device_get_major
-udisks_block_device_get_minor
-udisks_block_device_get_part_entry
-udisks_block_device_get_part_entry_flags
-udisks_block_device_get_part_entry_label
-udisks_block_device_get_part_entry_number
-udisks_block_device_get_part_entry_offset
-udisks_block_device_get_part_entry_scheme
-udisks_block_device_get_part_entry_size
-udisks_block_device_get_part_entry_table
-udisks_block_device_get_part_entry_type
-udisks_block_device_get_part_entry_uuid
-udisks_block_device_get_part_table
-udisks_block_device_get_part_table_scheme
-udisks_block_device_get_preferred_device
-udisks_block_device_get_size
-udisks_block_device_get_symlinks
-udisks_block_device_get_hint_system
-udisks_block_device_get_hint_ignore
-udisks_block_device_get_hint_auto
-udisks_block_device_get_hint_name
-udisks_block_device_get_hint_icon_name
-udisks_block_device_dup_configuration
-udisks_block_device_dup_crypto_backing_device
-udisks_block_device_dup_device
-udisks_block_device_dup_drive
-udisks_block_device_dup_id_label
-udisks_block_device_dup_id_type
-udisks_block_device_dup_id_usage
-udisks_block_device_dup_id_uuid
-udisks_block_device_dup_id_version
-udisks_block_device_dup_part_entry_flags
-udisks_block_device_dup_part_entry_label
-udisks_block_device_dup_part_entry_scheme
-udisks_block_device_dup_part_entry_table
-udisks_block_device_dup_part_entry_type
-udisks_block_device_dup_part_entry_uuid
-udisks_block_device_dup_part_table_scheme
-udisks_block_device_dup_preferred_device
-udisks_block_device_dup_symlinks
-udisks_block_device_dup_hint_name
-udisks_block_device_dup_hint_icon_name
-udisks_block_device_set_configuration
-udisks_block_device_set_crypto_backing_device
-udisks_block_device_set_device
-udisks_block_device_set_drive
-udisks_block_device_set_id_label
-udisks_block_device_set_id_type
-udisks_block_device_set_id_usage
-udisks_block_device_set_id_uuid
-udisks_block_device_set_id_version
-udisks_block_device_set_major
-udisks_block_device_set_minor
-udisks_block_device_set_part_entry
-udisks_block_device_set_part_entry_flags
-udisks_block_device_set_part_entry_label
-udisks_block_device_set_part_entry_number
-udisks_block_device_set_part_entry_offset
-udisks_block_device_set_part_entry_scheme
-udisks_block_device_set_part_entry_size
-udisks_block_device_set_part_entry_table
-udisks_block_device_set_part_entry_type
-udisks_block_device_set_part_entry_uuid
-udisks_block_device_set_part_table
-udisks_block_device_set_part_table_scheme
-udisks_block_device_set_preferred_device
-udisks_block_device_set_size
-udisks_block_device_set_symlinks
-udisks_block_device_set_hint_system
-udisks_block_device_set_hint_ignore
-udisks_block_device_set_hint_auto
-udisks_block_device_set_hint_name
-udisks_block_device_set_hint_icon_name
-UDisksBlockDeviceProxy
-UDisksBlockDeviceProxyClass
-udisks_block_device_proxy_new
-udisks_block_device_proxy_new_finish
-udisks_block_device_proxy_new_sync
-udisks_block_device_proxy_new_for_bus
-udisks_block_device_proxy_new_for_bus_finish
-udisks_block_device_proxy_new_for_bus_sync
-UDisksBlockDeviceSkeleton
-UDisksBlockDeviceSkeletonClass
-udisks_block_device_skeleton_new
+<FILE>UDisksBlock</FILE>
+UDisksBlock
+UDisksBlockIface
+udisks_block_interface_info
+udisks_block_override_properties
+udisks_block_call_get_secret_configuration
+udisks_block_call_get_secret_configuration_finish
+udisks_block_call_get_secret_configuration_sync
+udisks_block_complete_get_secret_configuration
+udisks_block_call_add_configuration_item
+udisks_block_call_add_configuration_item_finish
+udisks_block_call_add_configuration_item_sync
+udisks_block_complete_add_configuration_item
+udisks_block_call_remove_configuration_item
+udisks_block_call_remove_configuration_item_finish
+udisks_block_call_remove_configuration_item_sync
+udisks_block_complete_remove_configuration_item
+udisks_block_call_update_configuration_item
+udisks_block_call_update_configuration_item_finish
+udisks_block_call_update_configuration_item_sync
+udisks_block_complete_update_configuration_item
+udisks_block_get_configuration
+udisks_block_get_crypto_backing_device
+udisks_block_get_device
+udisks_block_get_drive
+udisks_block_get_id_label
+udisks_block_get_id_type
+udisks_block_get_id_usage
+udisks_block_get_id_uuid
+udisks_block_get_id_version
+udisks_block_get_major
+udisks_block_get_minor
+udisks_block_get_part_entry
+udisks_block_get_part_entry_flags
+udisks_block_get_part_entry_label
+udisks_block_get_part_entry_number
+udisks_block_get_part_entry_offset
+udisks_block_get_part_entry_scheme
+udisks_block_get_part_entry_size
+udisks_block_get_part_entry_table
+udisks_block_get_part_entry_type
+udisks_block_get_part_entry_uuid
+udisks_block_get_part_table
+udisks_block_get_part_table_scheme
+udisks_block_get_preferred_device
+udisks_block_get_size
+udisks_block_get_symlinks
+udisks_block_get_hint_system
+udisks_block_get_hint_ignore
+udisks_block_get_hint_auto
+udisks_block_get_hint_name
+udisks_block_get_hint_icon_name
+udisks_block_dup_configuration
+udisks_block_dup_crypto_backing_device
+udisks_block_dup_device
+udisks_block_dup_drive
+udisks_block_dup_id_label
+udisks_block_dup_id_type
+udisks_block_dup_id_usage
+udisks_block_dup_id_uuid
+udisks_block_dup_id_version
+udisks_block_dup_part_entry_flags
+udisks_block_dup_part_entry_label
+udisks_block_dup_part_entry_scheme
+udisks_block_dup_part_entry_table
+udisks_block_dup_part_entry_type
+udisks_block_dup_part_entry_uuid
+udisks_block_dup_part_table_scheme
+udisks_block_dup_preferred_device
+udisks_block_dup_symlinks
+udisks_block_dup_hint_name
+udisks_block_dup_hint_icon_name
+udisks_block_set_configuration
+udisks_block_set_crypto_backing_device
+udisks_block_set_device
+udisks_block_set_drive
+udisks_block_set_id_label
+udisks_block_set_id_type
+udisks_block_set_id_usage
+udisks_block_set_id_uuid
+udisks_block_set_id_version
+udisks_block_set_major
+udisks_block_set_minor
+udisks_block_set_part_entry
+udisks_block_set_part_entry_flags
+udisks_block_set_part_entry_label
+udisks_block_set_part_entry_number
+udisks_block_set_part_entry_offset
+udisks_block_set_part_entry_scheme
+udisks_block_set_part_entry_size
+udisks_block_set_part_entry_table
+udisks_block_set_part_entry_type
+udisks_block_set_part_entry_uuid
+udisks_block_set_part_table
+udisks_block_set_part_table_scheme
+udisks_block_set_preferred_device
+udisks_block_set_size
+udisks_block_set_symlinks
+udisks_block_set_hint_system
+udisks_block_set_hint_ignore
+udisks_block_set_hint_auto
+udisks_block_set_hint_name
+udisks_block_set_hint_icon_name
+UDisksBlockProxy
+UDisksBlockProxyClass
+udisks_block_proxy_new
+udisks_block_proxy_new_finish
+udisks_block_proxy_new_sync
+udisks_block_proxy_new_for_bus
+udisks_block_proxy_new_for_bus_finish
+udisks_block_proxy_new_for_bus_sync
+UDisksBlockSkeleton
+UDisksBlockSkeletonClass
+udisks_block_skeleton_new
<SUBSECTION Standard>
-UDISKS_TYPE_BLOCK_DEVICE
-UDISKS_IS_BLOCK_DEVICE
-UDISKS_BLOCK_DEVICE
-UDISKS_BLOCK_DEVICE_GET_IFACE
-UDISKS_TYPE_BLOCK_DEVICE_PROXY
-UDISKS_IS_BLOCK_DEVICE_PROXY
-UDISKS_IS_BLOCK_DEVICE_PROXY_CLASS
-UDISKS_BLOCK_DEVICE_PROXY
-UDISKS_BLOCK_DEVICE_PROXY_CLASS
-UDISKS_BLOCK_DEVICE_PROXY_GET_CLASS
-UDISKS_TYPE_BLOCK_DEVICE_SKELETON
-UDISKS_IS_BLOCK_DEVICE_SKELETON
-UDISKS_IS_BLOCK_DEVICE_SKELETON_CLASS
-UDISKS_BLOCK_DEVICE_SKELETON
-UDISKS_BLOCK_DEVICE_SKELETON_CLASS
-UDISKS_BLOCK_DEVICE_SKELETON_GET_CLASS
-UDisksBlockDeviceProxyPrivate
-UDisksBlockDeviceSkeletonPrivate
-udisks_block_device_get_type
-udisks_block_device_proxy_get_type
-udisks_block_device_skeleton_get_type
+UDISKS_TYPE_BLOCK
+UDISKS_IS_BLOCK
+UDISKS_BLOCK
+UDISKS_BLOCK_GET_IFACE
+UDISKS_TYPE_BLOCK_PROXY
+UDISKS_IS_BLOCK_PROXY
+UDISKS_IS_BLOCK_PROXY_CLASS
+UDISKS_BLOCK_PROXY
+UDISKS_BLOCK_PROXY_CLASS
+UDISKS_BLOCK_PROXY_GET_CLASS
+UDISKS_TYPE_BLOCK_SKELETON
+UDISKS_IS_BLOCK_SKELETON
+UDISKS_IS_BLOCK_SKELETON_CLASS
+UDISKS_BLOCK_SKELETON
+UDISKS_BLOCK_SKELETON_CLASS
+UDISKS_BLOCK_SKELETON_GET_CLASS
+UDisksBlockProxyPrivate
+UDisksBlockSkeletonPrivate
+udisks_block_get_type
+udisks_block_proxy_get_type
+udisks_block_skeleton_get_type
</SECTION>
<SECTION>
udisks_drive_ata_get_type
udisks_drive_ata_proxy_get_type
udisks_drive_ata_skeleton_get_type
-udisks_block_device_get_type
-udisks_block_device_proxy_get_type
-udisks_block_device_skeleton_get_type
+udisks_block_get_type
+udisks_block_proxy_get_type
+udisks_block_skeleton_get_type
udisks_filesystem_get_type
udisks_filesystem_proxy_get_type
udisks_filesystem_skeleton_get_type
gpointer user_data)
{
dev_t *dev = user_data;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
gboolean ret;
ret = FALSE;
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block == NULL)
goto out;
- if (*dev == makedev (udisks_block_device_get_major (block),
- udisks_block_device_get_minor (block)))
+ if (*dev == makedev (udisks_block_get_major (block),
+ udisks_block_get_minor (block)))
ret = TRUE;
out:
}
/**
- * udisks_daemon_find_block_device:
+ * udisks_daemon_find_block:
* @daemon: A #UDisksDaemon.
* @block_device_number: A #dev_t with the device number to find.
*
* Returns: (transfer full): A #UDisksObject or %NULL if not found. Free with g_object_unref().
*/
UDisksObject *
-udisks_daemon_find_block_device (UDisksDaemon *daemon,
- dev_t block_device_number)
+udisks_daemon_find_block (UDisksDaemon *daemon,
+ dev_t block_device_number)
{
return udisks_daemon_wait_for_object_sync (daemon,
wait_for_dev_t_cb,
guint timeout_seconds,
GError **error);
-UDisksObject *udisks_daemon_find_block_device (UDisksDaemon *daemon,
+UDisksObject *udisks_daemon_find_block (UDisksDaemon *daemon,
dev_t block_device_number);
UDisksObject *udisks_daemon_find_object (UDisksDaemon *daemon,
uid_t user)
{
gboolean ret;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksCleanup *cleanup;
uid_t setup_by_user;
UDisksObject *crypto_object;
ret = FALSE;
cleanup = udisks_daemon_get_cleanup (daemon);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block == NULL)
goto out;
/* loop devices */
- if (udisks_cleanup_has_loop (cleanup, udisks_block_device_get_device (block), &setup_by_user, NULL))
+ if (udisks_cleanup_has_loop (cleanup, udisks_block_get_device (block), &setup_by_user, NULL))
{
if (setup_by_user == user)
{
}
/* LUKS devices */
- crypto_object = udisks_daemon_find_object (daemon, udisks_block_device_get_crypto_backing_device (block));
+ crypto_object = udisks_daemon_find_object (daemon, udisks_block_get_crypto_backing_device (block));
if (crypto_object != NULL)
{
- UDisksBlockDevice *crypto_block;
- crypto_block = udisks_object_peek_block_device (crypto_object);
+ UDisksBlock *crypto_block;
+ crypto_block = udisks_object_peek_block (crypto_object);
if (udisks_cleanup_find_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (crypto_block),
- udisks_block_device_get_minor (crypto_block)),
+ makedev (udisks_block_get_major (crypto_block),
+ udisks_block_get_minor (crypto_block)),
&setup_by_user, NULL))
{
if (setup_by_user == user)
*
* The follow variables can be used in @message
*
- * - udisks2.device - If @object has a #UDisksBlockDevice interface, this property is set to the value of the #UDisksBlockDevice::preferred-device property.
+ * - udisks2.device - If @object has a #UDisksBlock interface, this property is set to the value of the #UDisksBlock::preferred-device property.
*
* Returns: %TRUE if caller is authorized, %FALSE if not.
*/
PolkitAuthorizationResult *result;
GError *error;
gboolean ret;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
gboolean auth_no_user_interaction;
ret = FALSE;
/* setup other details that @message can use */
if (object != NULL)
{
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block != NULL)
- polkit_details_insert (details, "udisks2.device", udisks_block_device_get_preferred_device (block));
+ polkit_details_insert (details, "udisks2.device", udisks_block_get_preferred_device (block));
}
error = NULL;
/**
* SECTION:udiskslinuxblock
* @title: UDisksLinuxBlock
- * @short_description: Linux implementation of #UDisksBlockDevice
+ * @short_description: Linux implementation of #UDisksBlock
*
- * This type provides an implementation of the #UDisksBlockDevice
+ * This type provides an implementation of the #UDisksBlock
* interface on Linux.
*/
*/
struct _UDisksLinuxBlock
{
- UDisksBlockDeviceSkeleton parent_instance;
+ UDisksBlockSkeleton parent_instance;
};
struct _UDisksLinuxBlockClass
{
- UDisksBlockDeviceSkeletonClass parent_class;
+ UDisksBlockSkeletonClass parent_class;
};
-static void block_iface_init (UDisksBlockDeviceIface *iface);
+static void block_iface_init (UDisksBlockIface *iface);
-G_DEFINE_TYPE_WITH_CODE (UDisksLinuxBlock, udisks_linux_block, UDISKS_TYPE_BLOCK_DEVICE_SKELETON,
- G_IMPLEMENT_INTERFACE (UDISKS_TYPE_BLOCK_DEVICE, block_iface_init));
+G_DEFINE_TYPE_WITH_CODE (UDisksLinuxBlock, udisks_linux_block, UDISKS_TYPE_BLOCK_SKELETON,
+ G_IMPLEMENT_INTERFACE (UDISKS_TYPE_BLOCK, block_iface_init));
/* ---------------------------------------------------------------------------------------------------- */
*
* Returns: A new #UDisksLinuxBlock. Free with g_object_unref().
*/
-UDisksBlockDevice *
+UDisksBlock *
udisks_linux_block_new (void)
{
- return UDISKS_BLOCK_DEVICE (g_object_new (UDISKS_TYPE_LINUX_BLOCK,
- NULL));
+ return UDISKS_BLOCK (g_object_new (UDISKS_TYPE_LINUX_BLOCK,
+ NULL));
}
/* ---------------------------------------------------------------------------------------------------- */
GUdevDevice *device,
UDisksDrive *drive)
{
- UDisksBlockDevice *iface = UDISKS_BLOCK_DEVICE (block);
+ UDisksBlock *iface = UDISKS_BLOCK (block);
gboolean hint_system;
gboolean hint_ignore;
gboolean hint_auto;
hint_icon_name = g_udev_device_get_property (device, "UDISKS_ICON_NAME");
/* ... and scene! */
- udisks_block_device_set_hint_system (iface, hint_system);
- udisks_block_device_set_hint_ignore (iface, hint_ignore);
- udisks_block_device_set_hint_auto (iface, hint_auto);
- udisks_block_device_set_hint_name (iface, hint_name);
- udisks_block_device_set_hint_icon_name (iface, hint_icon_name);
+ udisks_block_set_hint_system (iface, hint_system);
+ udisks_block_set_hint_ignore (iface, hint_ignore);
+ udisks_block_set_hint_auto (iface, hint_auto);
+ udisks_block_set_hint_name (iface, hint_name);
+ udisks_block_set_hint_icon_name (iface, hint_icon_name);
}
/* ---------------------------------------------------------------------------------------------------- */
goto continue_loop;
}
- if (g_strcmp0 (device, udisks_block_device_get_device (UDISKS_BLOCK_DEVICE (block))) == 0)
+ if (g_strcmp0 (device, udisks_block_get_device (UDISKS_BLOCK (block))) == 0)
{
ret = g_list_prepend (ret, g_object_ref (entry));
}
else
{
- symlinks = udisks_block_device_get_symlinks (UDISKS_BLOCK_DEVICE (block));
+ symlinks = udisks_block_get_symlinks (UDISKS_BLOCK (block));
if (symlinks != NULL)
{
for (n = 0; symlinks[n] != NULL; n++)
goto continue_loop;
}
- if (g_strcmp0 (device, udisks_block_device_get_device (UDISKS_BLOCK_DEVICE (block))) == 0)
+ if (g_strcmp0 (device, udisks_block_get_device (UDISKS_BLOCK (block))) == 0)
{
ret = g_list_prepend (ret, g_object_ref (entry));
}
else
{
- symlinks = udisks_block_device_get_symlinks (UDISKS_BLOCK_DEVICE (block));
+ symlinks = udisks_block_get_symlinks (UDISKS_BLOCK (block));
if (symlinks != NULL)
{
for (n = 0; symlinks[n] != NULL; n++)
g_error_free (error);
configuration = g_variant_new ("a(sa{sv})", NULL);
}
- udisks_block_device_set_configuration (UDISKS_BLOCK_DEVICE (block), configuration);
+ udisks_block_set_configuration (UDISKS_BLOCK (block), configuration);
}
/* ---------------------------------------------------------------------------------------------------- */
udisks_linux_block_update (UDisksLinuxBlock *block,
UDisksLinuxBlockObject *object)
{
- UDisksBlockDevice *iface = UDISKS_BLOCK_DEVICE (block);
+ UDisksBlock *iface = UDISKS_BLOCK (block);
UDisksDaemon *daemon;
GDBusObjectManagerServer *object_manager;
GUdevDevice *device;
device_file = g_udev_device_get_device_file (device);
symlinks = g_udev_device_get_device_file_symlinks (device);
- udisks_block_device_set_device (iface, device_file);
- udisks_block_device_set_symlinks (iface, symlinks);
- udisks_block_device_set_major (iface, major (dev));
- udisks_block_device_set_minor (iface, minor (dev));
- udisks_block_device_set_size (iface, udisks_daemon_util_block_get_size (device));
+ udisks_block_set_device (iface, device_file);
+ udisks_block_set_symlinks (iface, symlinks);
+ udisks_block_set_major (iface, major (dev));
+ udisks_block_set_minor (iface, minor (dev));
+ udisks_block_set_size (iface, udisks_daemon_util_block_get_size (device));
/* dm-crypt
*
* is a dm-crypt device.. but unfortunately device-mapper keeps all this stuff
* in user-space and wants you to use libdevmapper to obtain it...
*/
- udisks_block_device_set_crypto_backing_device (iface, "/");
+ udisks_block_set_crypto_backing_device (iface, "/");
if (g_str_has_prefix (g_udev_device_get_name (device), "dm-"))
{
gchar *dm_uuid;
slave_object_path = find_block_device_by_sysfs_path (object_manager, slaves[0]);
if (slave_object_path != NULL)
{
- udisks_block_device_set_crypto_backing_device (iface, slave_object_path);
+ udisks_block_set_crypto_backing_device (iface, slave_object_path);
}
g_free (slave_object_path);
}
/* fallback to the device name */
if (preferred_device_file == NULL)
preferred_device_file = g_udev_device_get_device_file (device);
- udisks_block_device_set_preferred_device (iface, preferred_device_file);
+ udisks_block_set_preferred_device (iface, preferred_device_file);
/* Determine the drive this block device belongs to
*
drive_object_path = find_drive (object_manager, device, &drive);
if (drive_object_path != NULL)
{
- udisks_block_device_set_drive (iface, drive_object_path);
+ udisks_block_set_drive (iface, drive_object_path);
g_free (drive_object_path);
}
else
{
- udisks_block_device_set_drive (iface, "/");
+ udisks_block_set_drive (iface, "/");
}
- udisks_block_device_set_id_usage (iface, g_udev_device_get_property (device, "ID_FS_USAGE"));
- udisks_block_device_set_id_type (iface, g_udev_device_get_property (device, "ID_FS_TYPE"));
+ udisks_block_set_id_usage (iface, g_udev_device_get_property (device, "ID_FS_USAGE"));
+ udisks_block_set_id_type (iface, g_udev_device_get_property (device, "ID_FS_TYPE"));
s = udisks_decode_udev_string (g_udev_device_get_property (device, "ID_FS_VERSION"));
- udisks_block_device_set_id_version (iface, s);
+ udisks_block_set_id_version (iface, s);
g_free (s);
s = udisks_decode_udev_string (g_udev_device_get_property (device, "ID_FS_LABEL_ENC"));
- udisks_block_device_set_id_label (iface, s);
+ udisks_block_set_id_label (iface, s);
g_free (s);
s = udisks_decode_udev_string (g_udev_device_get_property (device, "ID_FS_UUID_ENC"));
- udisks_block_device_set_id_uuid (iface, s);
+ udisks_block_set_id_uuid (iface, s);
g_free (s);
/* TODO: port this to blkid properties */
/* partition table */
if (is_partition_table)
{
- udisks_block_device_set_part_table (iface, TRUE);
- udisks_block_device_set_part_table_scheme (iface,
- g_udev_device_get_property (device,
- "UDISKS_PARTITION_TABLE_SCHEME"));
+ udisks_block_set_part_table (iface, TRUE);
+ udisks_block_set_part_table_scheme (iface,
+ g_udev_device_get_property (device,
+ "UDISKS_PARTITION_TABLE_SCHEME"));
}
else
{
- udisks_block_device_set_part_table (iface, FALSE);
- udisks_block_device_set_part_table_scheme (iface, "");
+ udisks_block_set_part_table (iface, FALSE);
+ udisks_block_set_part_table_scheme (iface, "");
}
/* partition entry */
if (is_partition_entry)
{
gchar *slave_sysfs_path;
- udisks_block_device_set_part_entry (iface, TRUE);
- udisks_block_device_set_part_entry_scheme (iface,
- g_udev_device_get_property (device,
- "UDISKS_PARTITION_SCHEME"));
- udisks_block_device_set_part_entry_number (iface,
- g_udev_device_get_property_as_int (device,
- "UDISKS_PARTITION_NUMBER"));
- udisks_block_device_set_part_entry_type (iface,
- g_udev_device_get_property (device,
- "UDISKS_PARTITION_TYPE"));
- udisks_block_device_set_part_entry_flags (iface,
- g_udev_device_get_property (device,
- "UDISKS_PARTITION_FLAGS"));
- udisks_block_device_set_part_entry_label (iface,
- g_udev_device_get_property (device,
- "UDISKS_PARTITION_LABEL"));
- udisks_block_device_set_part_entry_uuid (iface,
- g_udev_device_get_property (device,
- "UDISKS_PARTITION_UUID"));
+ udisks_block_set_part_entry (iface, TRUE);
+ udisks_block_set_part_entry_scheme (iface,
+ g_udev_device_get_property (device,
+ "UDISKS_PARTITION_SCHEME"));
+ udisks_block_set_part_entry_number (iface,
+ g_udev_device_get_property_as_int (device,
+ "UDISKS_PARTITION_NUMBER"));
+ udisks_block_set_part_entry_type (iface,
+ g_udev_device_get_property (device,
+ "UDISKS_PARTITION_TYPE"));
+ udisks_block_set_part_entry_flags (iface,
+ g_udev_device_get_property (device,
+ "UDISKS_PARTITION_FLAGS"));
+ udisks_block_set_part_entry_label (iface,
+ g_udev_device_get_property (device,
+ "UDISKS_PARTITION_LABEL"));
+ udisks_block_set_part_entry_uuid (iface,
+ g_udev_device_get_property (device,
+ "UDISKS_PARTITION_UUID"));
slave_sysfs_path = g_strdup (g_udev_device_get_property (device, "UDISKS_PARTITION_SLAVE"));
if (slave_sysfs_path == NULL)
{
gchar *slave_object_path;
slave_object_path = find_block_device_by_sysfs_path (object_manager, slave_sysfs_path);
if (slave_object_path != NULL)
- udisks_block_device_set_part_entry_table (iface, slave_object_path);
+ udisks_block_set_part_entry_table (iface, slave_object_path);
else
- udisks_block_device_set_part_entry_table (iface, "/");
+ udisks_block_set_part_entry_table (iface, "/");
g_free (slave_object_path);
g_free (slave_sysfs_path);
}
else
{
- udisks_block_device_set_part_entry_table (iface, "/");
+ udisks_block_set_part_entry_table (iface, "/");
}
- udisks_block_device_set_part_entry_offset (iface,
- g_udev_device_get_property_as_uint64 (device,
- "UDISKS_PARTITION_OFFSET"));
- udisks_block_device_set_part_entry_size (iface,
- g_udev_device_get_property_as_uint64 (device,
- "UDISKS_PARTITION_SIZE"));
+ udisks_block_set_part_entry_offset (iface,
+ g_udev_device_get_property_as_uint64 (device,
+ "UDISKS_PARTITION_OFFSET"));
+ udisks_block_set_part_entry_size (iface,
+ g_udev_device_get_property_as_uint64 (device,
+ "UDISKS_PARTITION_SIZE"));
}
else
{
- udisks_block_device_set_part_entry (iface, FALSE);
- udisks_block_device_set_part_entry_scheme (iface, "");
- udisks_block_device_set_part_entry_type (iface, "");
- udisks_block_device_set_part_entry_flags (iface, "");
- udisks_block_device_set_part_entry_table (iface, "/");
- udisks_block_device_set_part_entry_offset (iface, 0);
- udisks_block_device_set_part_entry_size (iface, 0);
+ udisks_block_set_part_entry (iface, FALSE);
+ udisks_block_set_part_entry_scheme (iface, "");
+ udisks_block_set_part_entry_type (iface, "");
+ udisks_block_set_part_entry_flags (iface, "");
+ udisks_block_set_part_entry_table (iface, "/");
+ udisks_block_set_part_entry_offset (iface, 0);
+ udisks_block_set_part_entry_size (iface, 0);
}
update_hints (block, device, drive);
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-handle_get_secret_configuration (UDisksBlockDevice *_block,
+handle_get_secret_configuration (UDisksBlock *_block,
GDBusMethodInvocation *invocation,
GVariant *options)
{
goto out;
}
- udisks_block_device_complete_get_secret_configuration (UDISKS_BLOCK_DEVICE (block),
- invocation,
- configuration); /* consumes floating ref */
+ udisks_block_complete_get_secret_configuration (UDISKS_BLOCK (block),
+ invocation,
+ configuration); /* consumes floating ref */
out:
return TRUE; /* returning TRUE means that we handled the method invocation */
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-handle_add_configuration_item (UDisksBlockDevice *_block,
+handle_add_configuration_item (UDisksBlock *_block,
GDBusMethodInvocation *invocation,
GVariant *item,
GVariant *options)
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- udisks_block_device_complete_add_configuration_item (UDISKS_BLOCK_DEVICE (block), invocation);
+ udisks_block_complete_add_configuration_item (UDISKS_BLOCK (block), invocation);
}
else if (g_strcmp0 (type, "crypttab") == 0)
{
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- udisks_block_device_complete_add_configuration_item (UDISKS_BLOCK_DEVICE (block), invocation);
+ udisks_block_complete_add_configuration_item (UDISKS_BLOCK (block), invocation);
}
else
{
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-handle_remove_configuration_item (UDisksBlockDevice *_block,
+handle_remove_configuration_item (UDisksBlock *_block,
GDBusMethodInvocation *invocation,
GVariant *item,
GVariant *options)
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- udisks_block_device_complete_add_configuration_item (UDISKS_BLOCK_DEVICE (block), invocation);
+ udisks_block_complete_add_configuration_item (UDISKS_BLOCK (block), invocation);
}
else if (g_strcmp0 (type, "crypttab") == 0)
{
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- udisks_block_device_complete_add_configuration_item (UDISKS_BLOCK_DEVICE (block), invocation);
+ udisks_block_complete_add_configuration_item (UDISKS_BLOCK (block), invocation);
}
else
{
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-handle_update_configuration_item (UDisksBlockDevice *_block,
+handle_update_configuration_item (UDisksBlock *_block,
GDBusMethodInvocation *invocation,
GVariant *old_item,
GVariant *new_item,
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- udisks_block_device_complete_add_configuration_item (UDISKS_BLOCK_DEVICE (block), invocation);
+ udisks_block_complete_add_configuration_item (UDISKS_BLOCK (block), invocation);
}
else if (g_strcmp0 (old_type, "crypttab") == 0)
{
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- udisks_block_device_complete_add_configuration_item (UDISKS_BLOCK_DEVICE (block), invocation);
+ udisks_block_complete_add_configuration_item (UDISKS_BLOCK (block), invocation);
}
else
{
/* ---------------------------------------------------------------------------------------------------- */
static void
-block_iface_init (UDisksBlockDeviceIface *iface)
+block_iface_init (UDisksBlockIface *iface)
{
iface->handle_get_secret_configuration = handle_get_secret_configuration;
iface->handle_add_configuration_item = handle_add_configuration_item;
#define UDISKS_IS_LINUX_BLOCK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UDISKS_TYPE_LINUX_BLOCK))
GType udisks_linux_block_get_type (void) G_GNUC_CONST;
-UDisksBlockDevice *udisks_linux_block_new (void);
+UDisksBlock *udisks_linux_block_new (void);
void udisks_linux_block_update (UDisksLinuxBlock *block,
UDisksLinuxBlockObject *object);
GUdevDevice *device;
/* interface */
- UDisksBlockDevice *iface_block_device;
+ UDisksBlock *iface_block_device;
UDisksFilesystem *iface_filesystem;
UDisksSwapspace *iface_swapspace;
UDisksEncrypted *iface_encrypted;
}
/* ---------------------------------------------------------------------------------------------------- */
-/* org.freedesktop.UDisks.BlockDevice */
+/* org.freedesktop.UDisks.Block */
static gboolean
block_device_check (UDisksLinuxBlockObject *object)
UDisksMountType mount_type;
ret = FALSE;
- if (g_strcmp0 (udisks_block_device_get_id_usage (object->iface_block_device), "filesystem") == 0 ||
+ if (g_strcmp0 (udisks_block_get_id_usage (object->iface_block_device), "filesystem") == 0 ||
(udisks_mount_monitor_is_dev_in_use (object->mount_monitor,
g_udev_device_get_device_number (object->device),
&mount_type) &&
UDisksMountType mount_type;
ret = FALSE;
- if ((g_strcmp0 (udisks_block_device_get_id_usage (object->iface_block_device), "other") == 0 &&
- g_strcmp0 (udisks_block_device_get_id_type (object->iface_block_device), "swap") == 0)
+ if ((g_strcmp0 (udisks_block_get_id_usage (object->iface_block_device), "other") == 0 &&
+ g_strcmp0 (udisks_block_get_id_type (object->iface_block_device), "swap") == 0)
|| (udisks_mount_monitor_is_dev_in_use (object->mount_monitor,
g_udev_device_get_device_number (object->device),
&mount_type)
gboolean ret;
ret = FALSE;
- if (g_strcmp0 (udisks_block_device_get_id_usage (object->iface_block_device), "crypto") == 0 &&
- g_strcmp0 (udisks_block_device_get_id_type (object->iface_block_device), "crypto_LUKS") == 0)
+ if (g_strcmp0 (udisks_block_get_id_usage (object->iface_block_device), "crypto") == 0 &&
+ g_strcmp0 (udisks_block_get_id_type (object->iface_block_device), "crypto_LUKS") == 0)
ret = TRUE;
return ret;
UDisksLinuxDrive *drive = UDISKS_LINUX_DRIVE (_drive);
UDisksLinuxDriveObject *object;
UDisksLinuxBlockObject *block_object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
const gchar *action_id;
gchar *error_message;
"Unable to find physical block device for drive");
goto out;
}
- block = udisks_object_peek_block_device (UDISKS_OBJECT (block_object));
+ block = udisks_object_peek_block (UDISKS_OBJECT (block_object));
/* TODO: is it a good idea to overload modify-device? */
action_id = "org.freedesktop.udisks2.modify-device";
- if (udisks_block_device_get_hint_system (block))
+ if (udisks_block_get_hint_system (block))
action_id = "org.freedesktop.udisks2.modify-device-system";
/* Check that the user is actually authorized */
&error_message,
NULL, /* input_string */
"eject \"%s\"",
- udisks_block_device_get_device (block)))
+ udisks_block_get_device (block)))
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error eject %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error_message);
goto out;
}
UDisksLinuxDriveAta *drive = UDISKS_LINUX_DRIVE_ATA (_drive);
UDisksLinuxDriveObject *object;
UDisksLinuxBlockObject *block_object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
const gchar *action_id;
gboolean nowakeup;
"Unable to find physical block device for drive");
goto out;
}
- block = udisks_object_peek_block_device (UDISKS_OBJECT (block_object));
+ block = udisks_object_peek_block (UDISKS_OBJECT (block_object));
g_variant_lookup (options,
"nowakeup",
/* TODO: is it a good idea to overload modify-device? */
action_id = "org.freedesktop.udisks2.modify-device";
- if (udisks_block_device_get_hint_system (block))
+ if (udisks_block_get_hint_system (block))
action_id = "org.freedesktop.udisks2.modify-device-system";
/* Check that the user is actually authorized */
for (l = objects; l != NULL; l = l->next)
{
GDBusObjectSkeleton *iter_object = G_DBUS_OBJECT_SKELETON (l->data);
- UDisksBlockDevice *block;
+ UDisksBlock *block;
GUdevDevice *device;
gboolean is_disk;
if (!is_disk)
continue;
- block = udisks_object_peek_block_device (UDISKS_OBJECT (iter_object));
- if (g_strcmp0 (udisks_block_device_get_drive (block),
+ block = udisks_object_peek_block (UDISKS_OBJECT (iter_object));
+ if (g_strcmp0 (udisks_block_get_drive (block),
g_dbus_object_get_object_path (G_DBUS_OBJECT (object))) == 0)
{
ret = g_object_ref (iter_object);
gpointer user_data)
{
const gchar *crypto_object_path = user_data;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
gboolean ret;
ret = FALSE;
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block == NULL)
goto out;
- if (g_strcmp0 (udisks_block_device_get_crypto_backing_device (block), crypto_object_path) == 0)
+ if (g_strcmp0 (udisks_block_get_crypto_backing_device (block), crypto_object_path) == 0)
ret = TRUE;
out:
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-check_crypttab (UDisksBlockDevice *block,
+check_crypttab (UDisksBlock *block,
gboolean load_passphrase,
gboolean *out_found,
gchar **out_name,
const gchar *type;
GVariant *details;
- g_variant_iter_init (&iter, udisks_block_device_get_configuration (block));
+ g_variant_iter_init (&iter, udisks_block_get_configuration (block));
while (g_variant_iter_next (&iter, "(&s@a{sv})", &type, &details))
{
if (g_strcmp0 (type, "crypttab") == 0)
GVariant *options)
{
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
UDisksCleanup *cleanup;
gchar *error_message;
gchar *name;
gchar *escaped_name;
UDisksObject *cleartext_object;
- UDisksBlockDevice *cleartext_block;
+ UDisksBlock *cleartext_block;
GUdevDevice *udev_cleartext_device;
GError *error;
uid_t caller_uid;
cleartext_object = NULL;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (encrypted)));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
cleanup = udisks_daemon_get_cleanup (daemon);
*/
/* Fail if the device is not a LUKS device */
- if (!(g_strcmp0 (udisks_block_device_get_id_usage (block), "crypto") == 0 &&
- g_strcmp0 (udisks_block_device_get_id_type (block), "crypto_LUKS") == 0))
+ if (!(g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0 &&
+ g_strcmp0 (udisks_block_get_id_type (block), "crypto_LUKS") == 0))
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Device %s does not appear to be a LUKS device",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
NULL); /* error */
if (cleartext_object != NULL)
{
- UDisksBlockDevice *unlocked_block;
- unlocked_block = udisks_object_peek_block_device (cleartext_object);
+ UDisksBlock *unlocked_block;
+ unlocked_block = udisks_object_peek_block (cleartext_object);
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Device %s is already unlocked as %s",
- udisks_block_device_get_device (block),
- udisks_block_device_get_device (unlocked_block));
+ udisks_block_get_device (block),
+ udisks_block_get_device (unlocked_block));
goto out;
}
/* Now, check that the user is actually authorized to unlock the device.
*/
action_id = "org.freedesktop.udisks2.encrypted-unlock";
- if (udisks_block_device_get_hint_system (block) &&
+ if (udisks_block_get_hint_system (block) &&
!(udisks_daemon_util_setup_by_user (daemon, object, caller_uid)))
action_id = "org.freedesktop.udisks2.encrypted-unlock-system";
if (is_in_crypttab)
if (is_in_crypttab && crypttab_name != NULL)
name = g_strdup (crypttab_name);
else
- name = g_strdup_printf ("LUKS-udisks2-%s", udisks_block_device_get_id_uuid (block));
+ name = g_strdup_printf ("LUKS-udisks2-%s", udisks_block_get_id_uuid (block));
escaped_name = g_strescape (name, NULL);
/* if available, use and prefer the /etc/crypttab passphrase */
&error_message,
passphrase, /* input_string */
"cryptsetup luksOpen \"%s\" \"%s\"",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
escaped_name))
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error unlocking %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error_message);
goto out;
}
{
g_prefix_error (&error,
"Error waiting for cleartext object after unlocking %s",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
g_dbus_method_invocation_take_error (invocation, error);
goto out;
}
- cleartext_block = udisks_object_peek_block_device (cleartext_object);
+ cleartext_block = udisks_object_peek_block (cleartext_object);
udisks_notice ("Unlocked LUKS device %s as %s",
- udisks_block_device_get_device (block),
- udisks_block_device_get_device (cleartext_block));
+ udisks_block_get_device (block),
+ udisks_block_get_device (cleartext_block));
udev_cleartext_device = udisks_linux_block_object_get_device (UDISKS_LINUX_BLOCK_OBJECT (cleartext_object));
/* update the unlocked-luks file */
if (!udisks_cleanup_add_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (cleartext_block),
- udisks_block_device_get_minor (cleartext_block)),
- makedev (udisks_block_device_get_major (block),
- udisks_block_device_get_minor (block)),
+ makedev (udisks_block_get_major (cleartext_block),
+ udisks_block_get_minor (cleartext_block)),
+ makedev (udisks_block_get_major (block),
+ udisks_block_get_minor (block)),
g_udev_device_get_sysfs_attr (udev_cleartext_device, "dm/uuid"),
caller_uid,
&error))
GVariant *options)
{
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
UDisksCleanup *cleanup;
gchar *error_message;
gchar *name;
gchar *escaped_name;
UDisksObject *cleartext_object;
- UDisksBlockDevice *cleartext_block;
+ UDisksBlock *cleartext_block;
GUdevDevice *device;
uid_t unlocked_by_uid;
dev_t cleartext_device_from_file;
device = NULL;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (encrypted)));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
cleanup = udisks_daemon_get_cleanup (daemon);
*/
/* Fail if the device is not a LUKS device */
- if (!(g_strcmp0 (udisks_block_device_get_id_usage (block), "crypto") == 0 &&
- g_strcmp0 (udisks_block_device_get_id_type (block), "crypto_LUKS") == 0))
+ if (!(g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0 &&
+ g_strcmp0 (udisks_block_get_id_type (block), "crypto_LUKS") == 0))
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Device %s does not appear to be a LUKS device",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Device %s is not unlocked",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
- cleartext_block = udisks_object_peek_block_device (cleartext_object);
+ cleartext_block = udisks_object_peek_block (cleartext_object);
error = NULL;
cleartext_device_from_file = udisks_cleanup_find_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (block),
- udisks_block_device_get_minor (block)),
+ makedev (udisks_block_get_major (block),
+ udisks_block_get_minor (block)),
&unlocked_by_uid,
&error);
if (error != NULL)
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error when looking for entry `%s' in unlocked-luks: %s (%s, %d)",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message,
g_quark_to_string (error->domain),
error->code);
if (cleartext_device_from_file != 0)
{
if (!udisks_cleanup_ignore_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (cleartext_block),
- udisks_block_device_get_minor (cleartext_block))))
+ makedev (udisks_block_get_major (cleartext_block),
+ udisks_block_get_minor (cleartext_block))))
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_ALREADY_UNMOUNTING,
"Cannot lock %s as it's already being locked",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
}
if (cleartext_device_from_file != 0)
{
udisks_cleanup_unignore_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (cleartext_block),
- udisks_block_device_get_minor (cleartext_block)));
+ makedev (udisks_block_get_major (cleartext_block),
+ udisks_block_get_minor (cleartext_block)));
}
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error locking %s (%s): %s",
- udisks_block_device_get_device (cleartext_block),
- udisks_block_device_get_device (block),
+ udisks_block_get_device (cleartext_block),
+ udisks_block_get_device (block),
error_message);
goto out;
}
{
error = NULL;
if (!udisks_cleanup_remove_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (cleartext_block),
- udisks_block_device_get_minor (cleartext_block)),
+ makedev (udisks_block_get_major (cleartext_block),
+ udisks_block_get_minor (cleartext_block)),
&error))
{
if (error == NULL)
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error removing entry for `%s' from unlocked-luks: Entry not found",
- udisks_block_device_get_device (cleartext_block));
+ udisks_block_get_device (cleartext_block));
}
else
{
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error removing entry for `%s' from unlocked-luks: %s (%s, %d)",
- udisks_block_device_get_device (cleartext_block),
+ udisks_block_get_device (cleartext_block),
error->message,
g_quark_to_string (error->domain),
error->code);
g_error_free (error);
}
udisks_cleanup_unignore_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (cleartext_block),
- udisks_block_device_get_minor (cleartext_block)));
+ makedev (udisks_block_get_major (cleartext_block),
+ udisks_block_get_minor (cleartext_block)));
goto out;
}
udisks_cleanup_unignore_unlocked_luks (cleanup,
- makedev (udisks_block_device_get_major (cleartext_block),
- udisks_block_device_get_minor (cleartext_block)));
+ makedev (udisks_block_get_major (cleartext_block),
+ udisks_block_get_minor (cleartext_block)));
}
udisks_notice ("Locked LUKS device %s (was unlocked as %s)",
- udisks_block_device_get_device (block),
- udisks_block_device_get_device (cleartext_block));
+ udisks_block_get_device (block),
+ udisks_block_get_device (cleartext_block));
udisks_encrypted_complete_lock (encrypted, invocation);
/*
* calculate_fs_type: <internal>
- * @block: A #UDisksBlockDevice.
+ * @block: A #UDisksBlock.
* @given_options: The a{sv} #GVariant.
* @error: Return location for error or %NULL.
*
* Returns: A valid UTF-8 string with the filesystem type (may be "auto") or %NULL if @error is set. Free with g_free().
*/
static gchar *
-calculate_fs_type (UDisksBlockDevice *block,
+calculate_fs_type (UDisksBlock *block,
GVariant *given_options,
GError **error)
{
probed_fs_type = NULL;
if (block != NULL)
- probed_fs_type = udisks_block_device_get_id_type (block);
+ probed_fs_type = udisks_block_get_id_type (block);
fs_type_to_use = NULL;
if (g_variant_lookup (given_options,
/*
* calculate_mount_options: <internal>
- * @block: A #UDisksBlockDevice.
+ * @block: A #UDisksBlock.
* @caller_uid: The uid of the caller making the request.
* @fs_type: The filesystem type to use or %NULL.
* @options: Options requested by the caller.
* Returns: A string with mount options or %NULL if @error is set. Free with g_free().
*/
static gchar *
-calculate_mount_options (UDisksBlockDevice *block,
+calculate_mount_options (UDisksBlock *block,
uid_t caller_uid,
const gchar *fs_type,
GVariant *options,
/*
* calculate_mount_point: <internal>
- * @block: A #UDisksBlockDevice.
+ * @block: A #UDisksBlock.
* @fs_type: The file system type to mount with
* @error: Return location for error or %NULL.
*
* Returns: A UTF-8 string with the mount point to use or %NULL if @error is set. Free with g_free().
*/
static gchar *
-calculate_mount_point (UDisksBlockDevice *block,
+calculate_mount_point (UDisksBlock *block,
const gchar *fs_type,
GError **error)
{
uuid = NULL;
if (block != NULL)
{
- label = udisks_block_device_get_id_label (block);
- uuid = udisks_block_device_get_id_uuid (block);
+ label = udisks_block_get_id_label (block);
+ uuid = udisks_block_get_id_uuid (block);
}
/* NOTE: UTF-8 has the nice property that valid UTF-8 strings only contains
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
-is_in_fstab (UDisksBlockDevice *block,
+is_in_fstab (UDisksBlock *block,
const gchar *fstab_path,
gchar **out_mount_point)
{
/* udisks_debug ("device %d:%d for entry %s", major (sb.st_rdev), minor (sb.st_rdev), m->mnt_fsname); */
- if (makedev (udisks_block_device_get_major (block),
- udisks_block_device_get_minor (block)) == sb.st_rdev)
+ if (makedev (udisks_block_get_major (block),
+ udisks_block_get_minor (block)) == sb.st_rdev)
{
ret = TRUE;
if (out_mount_point != NULL)
* TODO: check if systemd has a specific "unit" for the device
*/
static gboolean
-is_system_managed (UDisksBlockDevice *block,
+is_system_managed (UDisksBlock *block,
gchar **out_mount_point)
{
gboolean ret;
GVariant *options)
{
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
UDisksCleanup *cleanup;
uid_t caller_uid;
system_managed = FALSE;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (filesystem)));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
cleanup = udisks_daemon_get_cleanup (daemon);
UDISKS_ERROR,
UDISKS_ERROR_ALREADY_MOUNTED,
"Device %s is already mounted at %s.\n",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
str->str);
g_string_free (str, TRUE);
goto out;
UDISKS_ERROR_FAILED,
"Error creating directory `%s' to be used for mounting %s: %m",
mount_point_to_use,
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
}
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error mounting system-managed device %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error_message);
goto out;
}
udisks_notice ("Mounted %s (system) at %s on behalf of uid %d",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
mount_point_to_use,
caller_uid);
/* update the mounted-fs file */
if (!udisks_cleanup_add_mounted_fs (cleanup,
mount_point_to_use,
- makedev (udisks_block_device_get_major (block), udisks_block_device_get_minor (block)),
+ makedev (udisks_block_get_major (block), udisks_block_get_minor (block)),
caller_uid,
TRUE, /* fstab_mounted */
&error))
*/
probed_fs_usage = NULL;
if (block != NULL)
- probed_fs_usage = udisks_block_device_get_id_usage (block);
+ probed_fs_usage = udisks_block_get_id_usage (block);
if (probed_fs_usage != NULL && strlen (probed_fs_usage) > 0 &&
g_strcmp0 (probed_fs_usage, "filesystem") != 0)
{
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Cannot mount block device %s with probed usage `%s' - expected `filesystem'",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
probed_fs_usage);
goto out;
}
* may be racing with other threads...
*/
action_id = "org.freedesktop.udisks2.filesystem-mount";
- if (udisks_block_device_get_hint_system (block) &&
+ if (udisks_block_get_hint_system (block) &&
!(udisks_daemon_util_setup_by_user (daemon, object, caller_uid)))
action_id = "org.freedesktop.udisks2.filesystem-mount-system";
if (!udisks_daemon_util_check_authorization_sync (daemon,
/* update the mounted-fs file */
if (!udisks_cleanup_add_mounted_fs (cleanup,
mount_point_to_use,
- makedev (udisks_block_device_get_major (block), udisks_block_device_get_minor (block)),
+ makedev (udisks_block_get_major (block), udisks_block_get_minor (block)),
caller_uid,
FALSE, /* fstab_mounted */
&error))
"mount -t \"%s\" -o \"%s\" \"%s\" \"%s\"",
escaped_fs_type_to_use,
escaped_mount_options_to_use,
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
escaped_mount_point_to_use))
{
/* ugh, something went wrong.. we need to clean up the created mount point
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error mounting %s at %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
mount_point_to_use,
error_message);
goto out;
}
udisks_notice ("Mounted %s at %s on behalf of uid %d",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
mount_point_to_use,
caller_uid);
GVariant *options)
{
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
UDisksCleanup *cleanup;
gchar *mount_point;
opt_force = FALSE;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (filesystem)));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
cleanup = udisks_daemon_get_cleanup (daemon);
system_managed = FALSE;
UDISKS_ERROR,
UDISKS_ERROR_NOT_MOUNTED,
"Device `%s' is not mounted",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error unmounting system-managed device %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error_message);
goto out;
}
udisks_notice ("Unmounted %s (system) from %s on behalf of uid %d",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
mount_point,
caller_uid);
udisks_filesystem_complete_unmount (filesystem, invocation);
error = NULL;
mount_point = udisks_cleanup_find_mounted_fs (cleanup,
- makedev (udisks_block_device_get_major (block), udisks_block_device_get_minor (block)),
+ makedev (udisks_block_get_major (block), udisks_block_get_minor (block)),
&mounted_by_uid,
&fstab_mounted,
&error);
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error when looking for entry `%s' in mounted-fs: %s (%s, %d)",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message,
g_quark_to_string (error->domain),
error->code);
UDISKS_ERROR,
UDISKS_ERROR_ALREADY_UNMOUNTING,
"Cannot unmount %s: Mount point `%s' is currently being unmounted",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
mount_point);
goto out;
}
NULL, /* input_string */
"umount %s \"%s\"",
opt_force ? "-l" : "",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
}
if (!rc)
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error unmounting %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error_message);
udisks_cleanup_unignore_mounted_fs (cleanup, mount_point);
goto out;
}
udisks_notice ("Unmounted %s on behalf of uid %d",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
caller_uid);
udisks_filesystem_complete_unmount (filesystem, invocation);
const gchar *label,
GVariant *options)
{
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksObject *object;
UDisksDaemon *daemon;
const gchar *probed_fs_usage;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (filesystem)));
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
- probed_fs_usage = udisks_block_device_get_id_usage (block);
- probed_fs_type = udisks_block_device_get_id_type (block);
+ probed_fs_usage = udisks_block_get_id_usage (block);
+ probed_fs_type = udisks_block_get_id_type (block);
/* TODO: add support for other fstypes */
if (!(g_strcmp0 (probed_fs_usage, "filesystem") == 0 &&
}
action_id = "org.freedesktop.udisks2.modify-device";
- if (udisks_block_device_get_hint_system (block))
+ if (udisks_block_get_hint_system (block))
action_id = "org.freedesktop.udisks2.modify-device-system";
/* Check that the user is actually authorized to change the
0, /* uid_t run_as_euid */
NULL, /* input_string */
"e2label %s %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
escaped_label);
g_signal_connect (job,
"completed",
GVariant *options)
{
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDaemon *daemon;
UDisksCleanup *cleanup;
gchar *error_message;
escaped_device = NULL;
object = g_object_ref (UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (loop))));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
cleanup = udisks_daemon_get_cleanup (daemon);
error = NULL;
if (!udisks_cleanup_has_loop (cleanup,
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
&setup_by_uid,
&error))
{
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error when looking for entry `%s' in loop: %s (%s, %d)",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message,
g_quark_to_string (error->domain),
error->code);
goto out;
}
- escaped_device = g_strescape (udisks_block_device_get_device (block), NULL);
+ escaped_device = g_strescape (udisks_block_get_device (block), NULL);
- if (!udisks_cleanup_ignore_loop (cleanup, udisks_block_device_get_device (block)))
+ if (!udisks_cleanup_ignore_loop (cleanup, udisks_block_get_device (block)))
{
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_ALREADY_UNMOUNTING,
"Cannot delete %s as it's currently being deleted",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
goto out;
}
"losetup -d \"%s\"",
escaped_device))
{
- udisks_cleanup_unignore_loop (cleanup, udisks_block_device_get_device (block));
+ udisks_cleanup_unignore_loop (cleanup, udisks_block_get_device (block));
g_dbus_method_invocation_return_error (invocation,
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error deleting %s: %s",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error_message);
goto out;
}
if (setup_by_uid != -1)
{
error = NULL;
- if (!udisks_cleanup_remove_loop (cleanup, udisks_block_device_get_device (block), &error))
+ if (!udisks_cleanup_remove_loop (cleanup, udisks_block_get_device (block), &error))
{
if (error == NULL)
{
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error removing entry for `%s' from loop file: Entry not found",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
}
else
{
UDISKS_ERROR,
UDISKS_ERROR_FAILED,
"Error removing entry for `%s' from loop file: %s (%s, %d)",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message,
g_quark_to_string (error->domain),
error->code);
g_error_free (error);
}
- udisks_cleanup_unignore_loop (cleanup, udisks_block_device_get_device (block));
+ udisks_cleanup_unignore_loop (cleanup, udisks_block_get_device (block));
goto out;
}
- udisks_cleanup_unignore_loop (cleanup, udisks_block_device_get_device (block));
+ udisks_cleanup_unignore_loop (cleanup, udisks_block_get_device (block));
}
udisks_notice ("Deleted loop device %s (was backed by %s)",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
udisks_loop_get_backing_file (loop));
udisks_loop_complete_delete (loop, invocation);
gpointer user_data)
{
WaitForLoopData *data = user_data;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksLoop *loop;
gboolean ret;
ret = FALSE;
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
loop = udisks_object_peek_loop (object);
if (block == NULL || loop == NULL)
goto out;
- if (g_strcmp0 (udisks_block_device_get_device (block), data->loop_device) != 0)
+ if (g_strcmp0 (udisks_block_get_device (block), data->loop_device) != 0)
goto out;
if (g_strcmp0 (udisks_loop_get_backing_file (loop), data->path) != 0)
provider->coldplug = FALSE;
- /* update BlockDevice:Configuration whenever fstab or crypttab entries are added or removed */
+ /* update Block:Configuration whenever fstab or crypttab entries are added or removed */
g_signal_connect (udisks_daemon_get_fstab_monitor (daemon),
"entry-added",
G_CALLBACK (fstab_monitor_on_entry_added),
{
UDisksObject *object;
UDisksDaemon *daemon;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksBaseJob *job;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (swapspace)));
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (!udisks_daemon_util_check_authorization_sync (daemon,
object,
0, /* uid_t run_as_euid */
NULL, /* input_string */
"swapon %s",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
g_signal_connect (job,
"completed",
G_CALLBACK (swapspace_start_on_job_completed),
{
UDisksObject *object;
UDisksDaemon *daemon;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksBaseJob *job;
object = UDISKS_OBJECT (g_dbus_interface_get_object (G_DBUS_INTERFACE (swapspace)));
daemon = udisks_linux_block_object_get_daemon (UDISKS_LINUX_BLOCK_OBJECT (object));
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
/* Now, check that the user is actually authorized to stop the swap space.
*
0, /* uid_t run_as_euid */
NULL, /* input_string */
"swapoff %s",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
g_signal_connect (job,
"completed",
G_CALLBACK (swapspace_stop_on_job_completed),
for (l = objects; l != NULL; l = l->next)
{
UDisksObject *object = UDISKS_OBJECT (l->data);
- UDisksBlockDevice *block;
+ UDisksBlock *block;
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block != NULL)
{
const gchar * const *symlinks;
guint n;
- if (g_strcmp0 (udisks_block_device_get_device (block), device) == 0)
+ if (g_strcmp0 (udisks_block_get_device (block), device) == 0)
{
ret = g_object_ref (object);
goto out;
}
- symlinks = udisks_block_device_get_symlinks (block);
+ symlinks = udisks_block_get_symlinks (block);
for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
{
if (g_strcmp0 (symlinks[n], device) == 0)
GList *l;
GList *objects;
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksFilesystem *filesystem;
guint n;
const gchar * const *mount_points;
gboolean is_mounted;
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
filesystem = udisks_object_peek_filesystem (object);
if (filesystem == NULL)
for (l = objects; l != NULL; l = l->next)
{
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
filesystem = udisks_object_peek_filesystem (object);
if (block != NULL)
if ((is_mount && !is_mounted) || (!is_mount && is_mounted))
{
const gchar * const *symlinks;
- g_print ("%s \n", udisks_block_device_get_device (block));
- symlinks = udisks_block_device_get_symlinks (block);
+ g_print ("%s \n", udisks_block_get_device (block));
+ symlinks = udisks_block_get_symlinks (block);
for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
g_print ("%s \n", symlinks[n]);
}
goto out;
}
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
filesystem = udisks_object_peek_filesystem (object);
if (filesystem == NULL)
{
goto try_again;
}
g_printerr ("Error mounting %s: %s\n",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message);
g_error_free (error);
g_object_unref (object);
goto out;
}
g_print ("Mounted %s at %s.\n",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
mount_path);
g_free (mount_path);
}
goto try_again;
}
g_printerr ("Error unmounting %s: %s\n",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message);
g_error_free (error);
g_object_unref (object);
goto out;
}
g_print ("Unmounted %s.\n",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
}
ret = 0;
for (l = objects; l != NULL; l = l->next)
{
UDisksObject *object = UDISKS_OBJECT (l->data);
- UDisksBlockDevice *block;
+ UDisksBlock *block;
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block != NULL)
{
- if (g_strcmp0 (udisks_block_device_get_crypto_backing_device (block), encrypted_object_path) == 0)
+ if (g_strcmp0 (udisks_block_get_crypto_backing_device (block), encrypted_object_path) == 0)
{
ret = TRUE;
goto out;
GList *l;
GList *objects;
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksEncrypted *encrypted;
guint n;
GVariant *options;
gboolean is_unlocked;
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
encrypted = udisks_object_peek_encrypted (object);
if (encrypted == NULL)
for (l = objects; l != NULL; l = l->next)
{
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block != NULL)
{
if ((is_unlock && !is_unlocked) || (!is_unlock && is_unlocked))
{
const gchar * const *symlinks;
- g_print ("%s \n", udisks_block_device_get_device (block));
- symlinks = udisks_block_device_get_symlinks (block);
+ g_print ("%s \n", udisks_block_get_device (block));
+ symlinks = udisks_block_get_symlinks (block);
for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
g_print ("%s \n", symlinks[n]);
}
goto out;
}
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
encrypted = udisks_object_peek_encrypted (object);
if (encrypted == NULL)
{
goto try_again;
}
g_printerr ("Error unlocking %s: %s\n",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message);
g_error_free (error);
g_object_unref (object);
cleartext_object = UDISKS_OBJECT (g_dbus_object_manager_get_object (udisks_client_get_object_manager (client),
(cleartext_object_path)));
g_print ("Unlocked %s as %s.\n",
- udisks_block_device_get_device (block),
- udisks_block_device_get_device (udisks_object_get_block_device (cleartext_object)));
+ udisks_block_get_device (block),
+ udisks_block_get_device (udisks_object_get_block (cleartext_object)));
g_object_unref (cleartext_object);
g_free (cleartext_object_path);
}
goto try_again;
}
g_printerr ("Error locking %s: %s\n",
- udisks_block_device_get_device (block),
+ udisks_block_get_device (block),
error->message);
g_error_free (error);
g_object_unref (object);
goto out;
}
g_print ("Locked %s.\n",
- udisks_block_device_get_device (block));
+ udisks_block_get_device (block));
}
ret = 0;
GList *l;
GList *objects;
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
guint n;
GVariant *options;
GVariantBuilder builder;
for (l = objects; l != NULL; l = l->next)
{
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (udisks_object_peek_loop (object) != NULL)
{
object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (object));
for (l = objects; l != NULL; l = l->next)
{
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (udisks_object_peek_loop (object) != NULL)
{
const gchar * const *symlinks;
- g_print ("%s \n", udisks_block_device_get_device (block));
- symlinks = udisks_block_device_get_symlinks (block);
+ g_print ("%s \n", udisks_block_get_device (block));
+ symlinks = udisks_block_get_symlinks (block);
for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
g_print ("%s \n", symlinks[n]);
}
(resulting_object_path)));
g_print ("Mapped file %s as %s.\n",
opt_loop_file,
- udisks_block_device_get_device (udisks_object_get_block_device (resulting_object)));
+ udisks_block_get_device (udisks_object_get_block (resulting_object)));
g_object_unref (resulting_object);
g_free (resulting_object_path);
}
goto delete_try_again;
}
g_printerr ("Error deleting loop device %s: %s\n",
- udisks_block_device_get_device (udisks_object_peek_block_device (object)),
+ udisks_block_get_device (udisks_object_peek_block (object)),
error->message);
g_error_free (error);
goto out;
GList *l;
GList *objects;
UDisksObject *object;
- UDisksBlockDevice *block;
+ UDisksBlock *block;
UDisksDrive *drive;
guint n;
for (l = objects; l != NULL; l = l->next)
{
object = UDISKS_OBJECT (l->data);
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block != NULL)
{
const gchar * const *symlinks;
- g_print ("%s \n", udisks_block_device_get_device (block));
- symlinks = udisks_block_device_get_symlinks (block);
+ g_print ("%s \n", udisks_block_get_device (block));
+ symlinks = udisks_block_get_symlinks (block);
for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
g_print ("%s \n", symlinks[n]);
}
/* ---------------------------------------------------------------------------------------------------- */
static GList *
-find_block_devices_for_drive (GList *objects,
- const gchar *drive_object_path)
+find_blocks_for_drive (GList *objects,
+ const gchar *drive_object_path)
{
GList *ret;
GList *l;
for (l = objects; l != NULL; l = l->next)
{
UDisksObject *object = UDISKS_OBJECT (l->data);
- UDisksBlockDevice *block;
+ UDisksBlock *block;
- block = udisks_object_get_block_device (object);
+ block = udisks_object_get_block (object);
if (block == NULL)
continue;
- if (g_strcmp0 (udisks_block_device_get_drive (block), drive_object_path) == 0)
+ if (g_strcmp0 (udisks_block_get_drive (block), drive_object_path) == 0)
{
ret = g_list_append (ret, g_object_ref (block));
}
{
UDisksObject *object = UDISKS_OBJECT (l->data);
UDisksDrive *drive;
- GList *block_devices;
+ GList *blocks;
const gchar *vendor;
const gchar *model;
const gchar *revision;
const gchar *serial;
gchar *vendor_model;
GString *str;
- gchar *block_device;
+ gchar *block;
GList *j;
drive = udisks_object_peek_drive (object);
continue;
str = g_string_new (NULL);
- block_devices = find_block_devices_for_drive (objects, g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
- for (j = block_devices; j != NULL; j = j->next)
+ blocks = find_blocks_for_drive (objects, g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
+ for (j = blocks; j != NULL; j = j->next)
{
- UDisksBlockDevice *block = UDISKS_BLOCK_DEVICE (j->data);
- if (!udisks_block_device_get_part_entry (block))
+ UDisksBlock *block = UDISKS_BLOCK (j->data);
+ if (!udisks_block_get_part_entry (block))
{
const gchar *device_file;
if (str->len > 0)
g_string_append (str, " ");
- device_file = udisks_block_device_get_device (block);
+ device_file = udisks_block_get_device (block);
if (g_str_has_prefix (device_file, "/dev/"))
g_string_append (str, device_file + 5);
else
}
if (str->len == 0)
g_string_append (str, "-");
- block_device = g_string_free (str, FALSE);
- g_list_foreach (block_devices, (GFunc) g_object_unref, NULL);
- g_list_free (block_devices);
+ block = g_string_free (str, FALSE);
+ g_list_foreach (blocks, (GFunc) g_object_unref, NULL);
+ g_list_free (blocks);
vendor = udisks_drive_get_vendor (drive);
model = udisks_drive_get_model (drive);
vendor_model,
revision,
serial,
- block_device);
- g_free (block_device);
+ block);
+ g_free (block);
}
#include <udisks/udisks.h>
static UDisksObject *
-lookup_object_for_block_device (UDisksClient *client,
- dev_t block_device)
+lookup_object_for_block (UDisksClient *client,
+ dev_t block_device)
{
UDisksObject *ret;
GList *objects;
for (l = objects; l != NULL; l = l->next)
{
UDisksObject *object = UDISKS_OBJECT (l->data);
- UDisksBlockDevice *block;
+ UDisksBlock *block;
- block = udisks_object_peek_block_device (object);
+ block = udisks_object_peek_block (object);
if (block != NULL)
{
- if (block_device == makedev (udisks_block_device_get_major (block),
- udisks_block_device_get_minor (block)))
+ if (block_device == makedev (udisks_block_get_major (block),
+ udisks_block_get_minor (block)))
{
ret = g_object_ref (object);
goto out;
goto out;
}
- object = lookup_object_for_block_device (client, block_device);
+ object = lookup_object_for_block (client, block_device);
if (object == NULL)
{
g_printerr ("Error finding object for block device %d:%d\n", major (block_device), minor (block_device));