Blame src/lib/plugin_apis/vdo.h

Packit 2ba279
#include <glib.h>
Packit 2ba279
#include <glib-object.h>
Packit 2ba279
#include <blockdev/utils.h>
Packit 2ba279
Packit 2ba279
Packit 2ba279
#ifndef BD_VDO
Packit 2ba279
#define BD_VDO
Packit 2ba279
Packit 2ba279
GQuark  bd_vdo_error_quark (void);
Packit 2ba279
Packit 2ba279
Packit 2ba279
#define BD_VDO_ERROR bd_vdo_error_quark ()
Packit 2ba279
typedef enum {
Packit 2ba279
    BD_VDO_ERROR_FAIL,
Packit 2ba279
} BDVDOError;
Packit 2ba279
Packit 2ba279
typedef enum {
Packit 2ba279
    BD_VDO_TECH_VDO = 0,
Packit 2ba279
} BDVDOTech;
Packit 2ba279
Packit 2ba279
typedef enum {
Packit 2ba279
    BD_VDO_TECH_MODE_CREATE              = 1 << 0,
Packit 2ba279
    BD_VDO_TECH_MODE_REMOVE              = 1 << 1,
Packit 2ba279
    BD_VDO_TECH_MODE_MODIFY              = 1 << 2,
Packit 2ba279
    BD_VDO_TECH_MODE_ACTIVATE_DEACTIVATE = 1 << 3,
Packit 2ba279
    BD_VDO_TECH_MODE_START_STOP          = 1 << 4,
Packit 2ba279
    BD_VDO_TECH_MODE_QUERY               = 1 << 5,
Packit 2ba279
    BD_VDO_TECH_MODE_GROW                = 1 << 6,
Packit 2ba279
} BDVDOTechMode;
Packit 2ba279
Packit 2ba279
typedef enum {
Packit 2ba279
    BD_VDO_WRITE_POLICY_SYNC,
Packit 2ba279
    BD_VDO_WRITE_POLICY_ASYNC,
Packit 2ba279
    BD_VDO_WRITE_POLICY_AUTO,
Packit 2ba279
    BD_VDO_WRITE_POLICY_UNKNOWN,
Packit 2ba279
} BDVDOWritePolicy;
Packit 2ba279
Packit 2ba279
#define BD_VDO_TYPE_INFO (bd_vdo_info_get_type ())
Packit 2ba279
GType  bd_vdo_info_get_type ();
Packit 2ba279
Packit 2ba279
Packit 2ba279
typedef struct BDVDOInfo {
Packit 2ba279
    gchar *name;
Packit 2ba279
    gchar *device;
Packit 2ba279
    gboolean active;
Packit 2ba279
    gboolean deduplication;
Packit 2ba279
    gboolean compression;
Packit 2ba279
    guint64 logical_size;
Packit 2ba279
    guint64 physical_size;
Packit 2ba279
    guint64 index_memory;
Packit 2ba279
    BDVDOWritePolicy write_policy;
Packit 2ba279
} BDVDOInfo;
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * BDVDOInfo:
Packit 2ba279
 * @name: name of the VDO volume
Packit 2ba279
 * @device: underlying block device
Packit 2ba279
 * @active: whether the volume is active or not
Packit 2ba279
 * @deduplication: whether deduplication is enabled
Packit 2ba279
 * @compression: whether compression is enabled
Packit 2ba279
 * @logical_size: logical size of the volume
Packit 2ba279
 * @physical_size: sphysical size of the volume
Packit 2ba279
 * @index_memory: index memory size
Packit 2ba279
 * @write_policy: write policy of the volume
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_info_free: (skip)
Packit 2ba279
 *
Packit 2ba279
 * Frees @info.
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
void  bd_vdo_info_free (BDVDOInfo *info);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_info_copy: (skip)
Packit 2ba279
 *
Packit 2ba279
 * Creates a new copy of @info.
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
BDVDOInfo* bd_vdo_info_copy (BDVDOInfo *info);
Packit 2ba279
Packit 2ba279
Packit 2ba279
Packit 2ba279
#define BD_VDO_TYPE_STATS (bd_vdo_stats_get_type ())
Packit 2ba279
GType  bd_vdo_stats_get_type ();
Packit 2ba279
Packit 2ba279
Packit 2ba279
typedef struct BDVDOStats {
Packit 2ba279
    gint64 block_size;
Packit 2ba279
    gint64 logical_block_size;
Packit 2ba279
    gint64 physical_blocks;
Packit 2ba279
    gint64 data_blocks_used;
Packit 2ba279
    gint64 overhead_blocks_used;
Packit 2ba279
    gint64 logical_blocks_used;
Packit 2ba279
    gint64 used_percent;
Packit 2ba279
    gint64 saving_percent;
Packit 2ba279
    gdouble write_amplification_ratio;
Packit 2ba279
} BDVDOStats;
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * BDVDOStats:
Packit 2ba279
 * @block_size: block size of a VDO volume, in bytes
Packit 2ba279
 * @logical_block_size: logical block size, in bytes
Packit 2ba279
 * @physical_blocks: total number of physical blocks allocated
Packit 2ba279
 * @data_blocks_used: number of physical blocks currently in use to store data
Packit 2ba279
 * @overhead_blocks_used: number of physical blocks currently in use to store VDO metadata
Packit 2ba279
 * @logical_blocks_used: number of logical blocks currently mapped
Packit 2ba279
 * @used_percent: percentage of physical blocks used
Packit 2ba279
 * @saving_percent: percentage of physical blocks saved
Packit 2ba279
 * @write_amplification_ratio: average number of block writes to the underlying storage per block written
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_stats_free: (skip)
Packit 2ba279
 *
Packit 2ba279
 * Frees @stats.
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
void  bd_vdo_stats_free (BDVDOStats *stats);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_stats_copy: (skip)
Packit 2ba279
 *
Packit 2ba279
 * Creates a new copy of @stats.
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats);
Packit 2ba279
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_is_tech_avail:
Packit 2ba279
 * @tech: the queried tech
Packit 2ba279
 * @mode: a bit mask of queried modes of operation (#BDVDOTechMode) for @tech
Packit 2ba279
 * @error: (out): place to store error (details about why the @tech-@mode combination is not available)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the @tech-@mode combination is available -- supported by the
Packit 2ba279
 *          plugin implementation and having all the runtime dependencies available
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_is_tech_avail (BDVDOTech tech, guint64 mode, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_get_write_policy_str:
Packit 2ba279
 * @policy: policy to get the string representation for
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: string representation of @policy or %NULL in case of error
Packit 2ba279
 *
Packit 2ba279
 * Tech category: always provided/supported
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
const gchar* bd_vdo_get_write_policy_str (BDVDOWritePolicy policy, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_get_write_policy_from_str:
Packit 2ba279
 * @policy_str: string representation of a write policy mode
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: write policy for the @mode_str or %BD_VDO_WRITE_POLICY_UNKNOWN if
Packit 2ba279
 *          failed to determine
Packit 2ba279
 *
Packit 2ba279
 * Tech category: always provided/supported
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
BDVDOWritePolicy  bd_vdo_get_write_policy_from_str (const gchar *policy_str, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_info:
Packit 2ba279
 * @name: a VDO volume to get information about
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: (transfer full): information about the VDO volume or %NULL
Packit 2ba279
 * in case of error (@error gets populated in those cases)
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_QUERY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
BDVDOInfo* bd_vdo_info (const gchar *name, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_create:
Packit 2ba279
 * @name: name for the VDO volume
Packit 2ba279
 * @backing_device: device to use for VDO storage
Packit 2ba279
 * @logical_size: logical VDO volume size or 0 for default (size of @backing_device)
Packit 2ba279
 * @index_memory: amount of index memory or 0 for default; note that only some
Packit 2ba279
 *                sizes are valid here (0.25, 0.5 and 0.75 GB and integer multiples of 1 GB)
Packit 2ba279
 *                invalid sizes will be rounded DOWN to nearest GB (or one of the allowed
Packit 2ba279
 *                decimal values)
Packit 2ba279
 * @compression: whether to enable compression or not
Packit 2ba279
 * @deduplication: whether to enable deduplication or not
Packit 2ba279
 * @write_policy: write policy for the volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully created or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_CREATE
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_create (const gchar *name, const gchar *backing_device, guint64 logical_size, guint64 index_memory, gboolean compression, gboolean deduplication, BDVDOWritePolicy write_policy, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_remove:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @force: force remove the volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully removed or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_MODIFY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_remove (const gchar *name, gboolean force, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_change_write_policy:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @write_policy: new write policy for the volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the policy was successfully changed or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_MODIFY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_change_write_policy (const gchar *name, BDVDOWritePolicy write_policy, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_enable_compression:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the compression was successfully enabled or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_MODIFY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_enable_compression (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_disable_compression:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the compression was successfully disabled or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_MODIFY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_disable_compression (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_enable_deduplication:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the deduplication was successfully enabled or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_MODIFY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_enable_deduplication (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_disable_deduplication:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the deduplication was successfully disabled or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_MODIFY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_disable_deduplication (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_activate:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully activated or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_ACTIVATE_DEACTIVATE
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_activate (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_deactivate:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully deactivated or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_ACTIVATE_DEACTIVATE
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_deactivate (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_start:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @rebuild: force rebuild the volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully started or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_START_STOP
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_start (const gchar *name, gboolean rebuild, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_stop:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @force: force stop the volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully stopped or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_START_STOP
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_stop (const gchar *name, gboolean force, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_grow_logical:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @size: new logical size for the volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO creation
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully resized or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_GROW
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_grow_logical (const gchar *name, guint64 size, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_grow_physical:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @extra: (allow-none) (array zero-terminated=1): extra options for the VDO tool
Packit 2ba279
 *                                                 (just passed to VDO as is)
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: whether the VDO volume was successfully grown or not
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_GROW
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
gboolean  bd_vdo_grow_physical (const gchar *name, const BDExtraArg **extra, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_get_stats:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: (transfer full): a structure containing selected statistics or %NULL in case of error (@error gets populated in those cases)
Packit 2ba279
 *
Packit 2ba279
 * In contrast to @bd_vdo_get_stats_full this function will only return selected statistics in a fixed structure. In case a value is not available, -1 would be returned.
Packit 2ba279
 *
Packit 2ba279
 * The following statistics are presented:
Packit 2ba279
 *   - `"block_size"`: The block size of a VDO volume, in bytes.
Packit 2ba279
 *   - `"logical_block_size"`: The logical block size, in bytes.
Packit 2ba279
 *   - `"physical_blocks"`: The total number of physical blocks allocated for a VDO volume.
Packit 2ba279
 *   - `"data_blocks_used"`: The number of physical blocks currently in use by a VDO volume to store data.
Packit 2ba279
 *   - `"overhead_blocks_used"`: The number of physical blocks currently in use by a VDO volume to store VDO metadata.
Packit 2ba279
 *   - `"logical_blocks_used"`: The number of logical blocks currently mapped.
Packit 2ba279
 *   - `"usedPercent"`: The percentage of physical blocks used on a VDO volume (= used blocks / allocated blocks * 100).
Packit 2ba279
 *   - `"savingPercent"`: The percentage of physical blocks saved on a VDO volume (= [logical blocks used - physical blocks used] / logical blocks used).
Packit 2ba279
 *   - `"writeAmplificationRatio"`: The average number of block writes to the underlying storage per block written to the VDO device.
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_QUERY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
BDVDOStats* bd_vdo_get_stats (const gchar *name, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
/**
Packit 2ba279
 * bd_vdo_get_stats_full:
Packit 2ba279
 * @name: name of an existing VDO volume
Packit 2ba279
 * @error: (out): place to store error (if any)
Packit 2ba279
 *
Packit 2ba279
 * Returns: (transfer full) (element-type utf8 utf8): hashtable of type string - string of available statistics or %NULL in case of error (@error gets populated in those cases)
Packit 2ba279
 *
Packit 2ba279
 * Statistics are collected from the values exposed by the kernel `kvdo` module at the `/sys/kvdo/<VDO_NAME>/statistics/` path. Some of the keys are computed to mimic the information produced by the vdo tools.
Packit 2ba279
 * Please note the contents of the hashtable may vary depending on the actual kvdo module version.
Packit 2ba279
 *
Packit 2ba279
 * Tech category: %BD_VDO_TECH_VDO-%BD_VDO_TECH_MODE_QUERY
Packit 2ba279
 *
Packit 2ba279
 * Deprecated: 2.24: Use LVM-VDO integration instead.
Packit 2ba279
 */
Packit 2ba279
GHashTable* bd_vdo_get_stats_full (const gchar *name, GError **error);
Packit 2ba279
Packit 2ba279
Packit 2ba279
#endif  /* BD_VDO_API */