DummyLinuxBlock

DummyLinuxBlock — Linux implementation of DummyDummyBlock

Synopsis

                    StoragedLinuxDriveAta;
StoragedDriveAta *  storaged_linux_drive_ata_new        (void);
gboolean            storaged_linux_drive_ata_update     (StoragedLinuxDriveAta *drive,
                                                         StoragedLinuxDriveObject *object);
gboolean            storaged_linux_drive_ata_refresh_smart_sync
                                                        (StoragedLinuxDriveAta *drive,
                                                         gboolean nowakeup,
                                                         const gchar *simulate_path,
                                                         GCancellable *cancellable,
                                                         GError **error);
gboolean            storaged_linux_drive_ata_smart_selftest_sync
                                                        (StoragedLinuxDriveAta *drive,
                                                         const gchar *type,
                                                         GCancellable *cancellable,
                                                         GError **error);
void                storaged_linux_drive_ata_apply_configuration
                                                        (StoragedLinuxDriveAta *drive,
                                                         StoragedLinuxDevice *device,
                                                         GVariant *configuration);
gboolean            storaged_linux_drive_ata_secure_erase_sync
                                                        (StoragedLinuxDriveAta *drive,
                                                         uid_t caller_uid,
                                                         gboolean enhanced,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GDBusInterfaceSkeleton
         +----StoragedDriveAtaSkeleton
               +----StoragedLinuxDriveAta

Implemented Interfaces

StoragedLinuxDriveAta implements GDBusInterface and StoragedDriveAta.

Description

This type provides an implementation of the DummyDummyBlock interface on Linux.

Details

StoragedLinuxDriveAta

typedef struct _StoragedLinuxDriveAta StoragedLinuxDriveAta;

The StoragedLinuxDriveAta structure contains only private data and should only be accessed using the provided API.


storaged_linux_drive_ata_new ()

StoragedDriveAta *  storaged_linux_drive_ata_new        (void);

Creates a new StoragedLinuxDriveAta instance.

Returns :

A new StoragedLinuxDriveAta. Free with g_object_unref().

storaged_linux_drive_ata_update ()

gboolean            storaged_linux_drive_ata_update     (StoragedLinuxDriveAta *drive,
                                                         StoragedLinuxDriveObject *object);

Updates the interface.

drive :

A StoragedLinuxDriveAta.

object :

The enclosing StoragedLinuxDriveObject instance.

Returns :

TRUE if configuration has changed, FALSE otherwise.

storaged_linux_drive_ata_refresh_smart_sync ()

gboolean            storaged_linux_drive_ata_refresh_smart_sync
                                                        (StoragedLinuxDriveAta *drive,
                                                         gboolean nowakeup,
                                                         const gchar *simulate_path,
                                                         GCancellable *cancellable,
                                                         GError **error);

Synchronously refreshes ATA S.M.A.R.T. data on drive using one of the physical drives associated with it. The calling thread is blocked until the data has been obtained.

If nowake is TRUE and the disk is in a sleep state this fails with STORAGED_ERROR_WOULD_WAKEUP.

This may only be called if drive has been associated with a StoragedLinuxDriveObject instance.

This method may be called from any thread.

drive :

The StoragedLinuxDriveAta to refresh.

nowakeup :

If TRUE, will not wake up the disk if asleep.

simulate_path :

If not NULL, the path of a file with a libatasmart blob to use.

cancellable :

A GCancellable or NULL.

error :

Return location for error.

Returns :

TRUE if the operation succeeded, FALSE if error is set.

storaged_linux_drive_ata_smart_selftest_sync ()

gboolean            storaged_linux_drive_ata_smart_selftest_sync
                                                        (StoragedLinuxDriveAta *drive,
                                                         const gchar *type,
                                                         GCancellable *cancellable,
                                                         GError **error);

Starts (or aborts) a SMART self-test on drive. Valid values for type includes 'short', 'extended', 'conveyance' and 'abort'.

The calling thread is blocked while sending the command to the drive but will return immediately after the drive acknowledges the command.

drive :

A StoragedLinuxDriveAta.

type :

The type of selftest to run.

cancellable :

A GCancellable that can be used to cancel the operation or NULL. [allow-none]

error :

Return location for error or NULL.

Returns :

TRUE if the operation succeed, FALSE if error is set.

storaged_linux_drive_ata_apply_configuration ()

void                storaged_linux_drive_ata_apply_configuration
                                                        (StoragedLinuxDriveAta *drive,
                                                         StoragedLinuxDevice *device,
                                                         GVariant *configuration);

Spawns a thread to apply configuration to drive, if any. Does not wait for the thread to terminate.

drive :

A StoragedLinuxDriveAta.

device :

A StoragedLinuxDevice

configuration :

The configuration to apply.

storaged_linux_drive_ata_secure_erase_sync ()

gboolean            storaged_linux_drive_ata_secure_erase_sync
                                                        (StoragedLinuxDriveAta *drive,
                                                         uid_t caller_uid,
                                                         gboolean enhanced,
                                                         GError **error);

Performs an ATA Secure Erase opeartion. Blocks the calling thread until the operation completes.

This operation may take a very long time (hours) to complete.

drive :

A StoragedLinuxDriveAta.

caller_uid :

The unix user if of the caller requesting the operation.

enhanced :

TRUE to use the enhanced version of the ATA secure erase command.

error :

Return location for error or NULL.

Returns :

TRUE if the operation succeeded, FALSE if error is set.