Blame src/lib/plugin_apis/vdo.h

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