Top |
UDisksDaemon * | daemon | Read / Write / Construct Only |
UDisksLinuxDevice * | device | Read / Write / Construct Only |
GObject ╰── GDBusObjectSkeleton ╰── UDisksObjectSkeleton ╰── UDisksLinuxBlockObject
UDisksLinuxBlockObject * udisks_linux_block_object_new (UDisksDaemon *daemon
,UDisksLinuxDevice *device
);
Create a new block object.
void udisks_linux_block_object_uevent (UDisksLinuxBlockObject *object
,const gchar *action
,UDisksLinuxDevice *device
);
Updates all information on interfaces on object
as a result of incoming uevent processing.
object |
||
action |
Uevent action or |
|
device |
A new UDisksLinuxDevice device object or |
UDisksDaemon *
udisks_linux_block_object_get_daemon (UDisksLinuxBlockObject *object
);
Gets the daemon used by object
.
UDisksLinuxDevice *
udisks_linux_block_object_get_device (UDisksLinuxBlockObject *object
);
Gets the current UDisksLinuxDevice for object
. Connect to
“notify” to track changes to the “device”
property.
gchar *
udisks_linux_block_object_get_device_file
(UDisksLinuxBlockObject *object
);
Gets the device path for this object (eg. /dev/sda1).
dev_t
udisks_linux_block_object_get_device_number
(UDisksLinuxBlockObject *object
);
Gets the device number for this object.
void
udisks_linux_block_object_trigger_uevent
(UDisksLinuxBlockObject *object
);
Triggers a 'change' uevent in the kernel.
The triggered event will bubble up from the kernel through the udev stack and will eventually be received by the udisks daemon process itself. This method does not wait for the event to be received.
gboolean udisks_linux_block_object_trigger_uevent_sync (UDisksLinuxBlockObject *object
,guint timeout_seconds
);
Triggers a 'change' uevent in the kernel and waits until it's received and processed by udisks.
Unlike udisks_linux_block_object_trigger_uevent()
that just triggers
a synthetic uevent to the kernel, this call will actually block and wait until
the UDisksLinuxProvider receives the uevent, performs probing and processes
the uevent further down the UDisks object stack. Upon returning from this
function call the caller may assume the event has been fully processed, all
D-Bus objects are updated and settled. Typically used in busy wait for
a particular D-Bus interface.
Note that this uses synthetic uevent tagging and only works on linux kernel
4.13 and higher. In case an older kernel is detected this acts like the classic
udisks_linux_block_object_trigger_uevent()
call and FALSE
is returned.
void
udisks_linux_block_object_reread_partition_table
(UDisksLinuxBlockObject *object
);
Requests the kernel to re-read the partition table for object
.
The events from any change this may cause will bubble up from the kernel through the udev stack and will eventually be received by the udisks daemon process itself. This method does not wait for the event to be received.
gboolean
udisks_linux_block_object_contains_filesystem
(UDisksObject *object
);
Check whether filesystem has been detected on the block device.
void
udisks_linux_block_object_lock_for_cleanup
(UDisksLinuxBlockObject *object
);
Acquires the "cleanup" lock of the block device object
. Typically used to signal
the cleanup thread that the block device is busy.
gboolean
udisks_linux_block_object_try_lock_for_cleanup
(UDisksLinuxBlockObject *object
);
Attempts to lock the block device object
for cleanup. Typically used by the cleanup
thread to check whether the block device is busy and cleanup can be performed.
void
udisks_linux_block_object_release_cleanup_lock
(UDisksLinuxBlockObject *object
);
Releases a lock previously acquired by udisks_linux_block_object_lock_for_cleanup()
.
typedef struct _UDisksLinuxBlockObject UDisksLinuxBlockObject;
The UDisksLinuxBlockObject structure contains only private data and should only be accessed using the provided API.
“daemon”
property“daemon” UDisksDaemon *
The UDisksDaemon the object is for.
Owner: UDisksLinuxBlockObject
Flags: Read / Write / Construct Only
“device”
property“device” UDisksLinuxDevice *
The UDisksLinuxDevice for the object. Connect to the “notify” signal to get notified whenever this is updated.
Owner: UDisksLinuxBlockObject
Flags: Read / Write / Construct Only