GduLinuxMdDrive

GduLinuxMdDrive — Linux Software RAID drives

Synopsis

                    GduLinuxMdDriveClass;
                    GduLinuxMdDrivePrivate;
                    GduLinuxMdDrive;
enum                GduLinuxMdDriveSlaveFlags;
const gchar *       gdu_linux_md_drive_get_uuid         (GduLinuxMdDrive *drive);
gboolean            gdu_linux_md_drive_has_slave        (GduLinuxMdDrive *drive,
                                                         GduDevice *device);
GList *             gdu_linux_md_drive_get_slaves       (GduLinuxMdDrive *drive);
GduLinuxMdDriveSlaveFlags  gdu_linux_md_drive_get_slave_flags
                                                        (GduLinuxMdDrive *drive,
                                                         GduDevice *slave);
gchar *             gdu_linux_md_drive_get_slave_state_markup
                                                        (GduLinuxMdDrive *drive,
                                                         GduDevice *slave);

Object Hierarchy

  GObject
   +----GduDrive
         +----GduLinuxMdDrive

Implemented Interfaces

GduLinuxMdDrive implements GduPresentable.

Description

The GduLinuxMdDrive class represents drives Linux Software RAID arrays.

An GduLinuxMdDrive drive is added to GduPool as soon as a component device that is part of the abstraction is available. The drive can be started (gdu_drive_start()) and stopped (gdu_drive_stop()) and the state of the underlying components can be queried through gdu_linux_md_drive_get_slave_flags()).

See the documentation for GduPresentable for the big picture.

Details

GduLinuxMdDriveClass

typedef struct {
        GduDriveClass parent_class;
} GduLinuxMdDriveClass;


GduLinuxMdDrivePrivate

typedef struct _GduLinuxMdDrivePrivate GduLinuxMdDrivePrivate;


GduLinuxMdDrive

typedef struct _GduLinuxMdDrive GduLinuxMdDrive;


enum GduLinuxMdDriveSlaveFlags

typedef enum {
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NONE          = 0,
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NOT_ATTACHED  = (1<<0),
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_FAULTY        = (1<<1),
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_IN_SYNC       = (1<<2),
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_WRITEMOSTLY   = (1<<3),
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_BLOCKED       = (1<<4),
        GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_SPARE         = (1<<5),
} GduLinuxMdDriveSlaveFlags;

State for slaves of an Linux MD software raid drive. Everything but GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NONE and GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NOT_ATTACHED corresponds to the comma-separated strings in /sys/block/mdXXX/md/dev-YYY/state in sysfs. See Documentation/md.txt in the Linux kernel for more information.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NONE

No flags are set.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_NOT_ATTACHED

If set, the slave is not part of the array but appears as a child only because the UUID on the device matches that of the array. Is also set if the array does not exist.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_FAULTY

Device has been kick from active use due to a detected fault.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_IN_SYNC

Device is a fully in-sync member of the array.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_WRITEMOSTLY

Device will only be subject to read requests if there are no other options. This applies only to RAID1 arrays.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_BLOCKED

Device has failed, metadata is "external", and the failure hasn't been acknowledged yet. Writes that would write to this device if it were not faulty are blocked.

GDU_LINUX_MD_DRIVE_SLAVE_FLAGS_SPARE

Device is working, but not a full member. This includes spares that in the process of being recovered to.

gdu_linux_md_drive_get_uuid ()

const gchar *       gdu_linux_md_drive_get_uuid         (GduLinuxMdDrive *drive);

drive :

Returns :


gdu_linux_md_drive_has_slave ()

gboolean            gdu_linux_md_drive_has_slave        (GduLinuxMdDrive *drive,
                                                         GduDevice *device);

Checks if device is a component of drive.

drive :

A GduLinuxMdDrive.

device :

A GduDevice.

Returns :

TRUE only if slave is a component of drive.

gdu_linux_md_drive_get_slaves ()

GList *             gdu_linux_md_drive_get_slaves       (GduLinuxMdDrive *drive);

Gets all slaves of drive.

drive :

A GduLinuxMdDrive.

Returns :

A GList of GduDevice objects. Caller must free this list (and call g_object_unref() on all elements).

gdu_linux_md_drive_get_slave_flags ()

GduLinuxMdDriveSlaveFlags  gdu_linux_md_drive_get_slave_flags
                                                        (GduLinuxMdDrive *drive,
                                                         GduDevice *slave);

Gets the state of slave of drive.

drive :

A GduLinuxMdDrive.

slave :

A GduDevice.

Returns :

A value from GduLinuxMdDriveSlaveState for slave.

gdu_linux_md_drive_get_slave_state_markup ()

gchar *             gdu_linux_md_drive_get_slave_state_markup
                                                        (GduLinuxMdDrive *drive,
                                                         GduDevice *slave);

drive :

slave :

Returns :