![]() |
![]() |
![]() |
libblockdev Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <lvm.h> #define BD_LVM_MAX_LV_SIZE #define BD_LVM_DEFAULT_PE_SIZE #define BD_LVM_DEFAULT_PE_START #define BD_LVM_MIN_PE_SIZE #define BD_LVM_MAX_PE_SIZE #define USE_DEFAULT_PE_SIZE #define RESOLVE_PE_SIZE (size) #define BD_LVM_MIN_THPOOL_MD_SIZE #define BD_LVM_MAX_THPOOL_MD_SIZE #define BD_LVM_MIN_THPOOL_CHUNK_SIZE #define BD_LVM_MAX_THPOOL_CHUNK_SIZE #define THPOOL_MD_FACTOR_NEW #define THPOOL_MD_FACTOR_EXISTS #define BD_LVM_MIN_CACHE_MD_SIZE GQuark bd_lvm_error_quark (void
); #define BD_LVM_ERROR enum BDLVMError; BDLVMPVdata; void bd_lvm_pvdata_free (BDLVMPVdata *data
); BDLVMPVdata * bd_lvm_pvdata_copy (BDLVMPVdata *data
); BDLVMVGdata; void bd_lvm_vgdata_free (BDLVMVGdata *data
); BDLVMVGdata * bd_lvm_vgdata_copy (BDLVMVGdata *data
); BDLVMLVdata; void bd_lvm_lvdata_free (BDLVMLVdata *data
); BDLVMLVdata * bd_lvm_lvdata_copy (BDLVMLVdata *data
); enum BDLVMCacheMode; enum BDLVMCachePoolFlags; BDLVMCacheStats; BDLVMCacheStats * bd_lvm_cache_stats_copy (BDLVMCacheStats *data
); void bd_lvm_cache_stats_free (BDLVMCacheStats *data
); gboolean bd_lvm_is_supported_pe_size (guint64 size
,GError **error
); guint64 * bd_lvm_get_supported_pe_sizes (GError **error
); guint64 bd_lvm_get_max_lv_size (GError **error
); guint64 bd_lvm_round_size_to_pe (guint64 size
,guint64 pe_size
,gboolean roundup
,GError **error
); guint64 bd_lvm_get_lv_physical_size (guint64 lv_size
,guint64 pe_size
,GError **error
); guint64 bd_lvm_get_thpool_padding (guint64 size
,guint64 pe_size
,gboolean included
,GError **error
); gboolean bd_lvm_is_valid_thpool_md_size (guint64 size
,GError **error
); gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size
,gboolean discard
,GError **error
); gboolean bd_lvm_pvcreate (gchar *device
,guint64 data_alignment
,guint64 metadata_size
,GError **error
); gboolean bd_lvm_pvresize (gchar *device
,guint64 size
,GError **error
); gboolean bd_lvm_pvremove (gchar *device
,GError **error
); gboolean bd_lvm_pvmove (gchar *src
,gchar *dest
,GError **error
); gboolean bd_lvm_pvscan (gchar *device
,gboolean update_cache
,GError **error
); BDLVMPVdata * bd_lvm_pvinfo (gchar *device
,GError **error
); BDLVMPVdata ** bd_lvm_pvs (GError **error
); gboolean bd_lvm_vgcreate (gchar *name
,gchar **pv_list
,guint64 pe_size
,GError **error
); gboolean bd_lvm_vgremove (gchar *vg_name
,GError **error
); gboolean bd_lvm_vgactivate (gchar *vg_name
,GError **error
); gboolean bd_lvm_vgdeactivate (gchar *vg_name
,GError **error
); gboolean bd_lvm_vgextend (gchar *vg_name
,gchar *device
,GError **error
); gboolean bd_lvm_vgreduce (gchar *vg_name
,gchar *device
,GError **error
); BDLVMVGdata * bd_lvm_vginfo (gchar *vg_name
,GError **error
); BDLVMVGdata ** bd_lvm_vgs (GError **error
); gchar * bd_lvm_lvorigin (gchar *vg_name
,gchar *lv_name
,GError **error
); gboolean bd_lvm_lvcreate (gchar *vg_name
,gchar *lv_name
,guint64 size
,gchar *type
,gchar **pv_list
,GError **error
); gboolean bd_lvm_lvremove (gchar *vg_name
,gchar *lv_name
,gboolean force
,GError **error
); gboolean bd_lvm_lvresize (gchar *vg_name
,gchar *lv_name
,guint64 size
,GError **error
); gboolean bd_lvm_lvactivate (gchar *vg_name
,gchar *lv_name
,gboolean ignore_skip
,GError **error
); gboolean bd_lvm_lvdeactivate (gchar *vg_name
,gchar *lv_name
,GError **error
); gboolean bd_lvm_lvsnapshotcreate (gchar *vg_name
,gchar *origin_name
,gchar *snapshot_name
,guint64 size
,GError **error
); gboolean bd_lvm_lvsnapshotmerge (gchar *vg_name
,gchar *snapshot_name
,GError **error
); BDLVMLVdata * bd_lvm_lvinfo (gchar *vg_name
,gchar *lv_name
,GError **error
); BDLVMLVdata ** bd_lvm_lvs (gchar *vg_name
,GError **error
); gboolean bd_lvm_thpoolcreate (gchar *vg_name
,gchar *lv_name
,guint64 size
,guint64 md_size
,guint64 chunk_size
,gchar *profile
,GError **error
); gboolean bd_lvm_thlvcreate (gchar *vg_name
,gchar *pool_name
,gchar *lv_name
,guint64 size
,GError **error
); gchar * bd_lvm_thlvpoolname (gchar *vg_name
,gchar *lv_name
,GError **error
); gboolean bd_lvm_thsnapshotcreate (gchar *vg_name
,gchar *origin_name
,gchar *snapshot_name
,gchar *pool_name
,GError **error
); gboolean bd_lvm_set_global_config (gchar *new_config
,GError **error
); gchar * bd_lvm_get_global_config (GError **error
); gboolean bd_lvm_cache_attach (gchar *vg_name
,gchar *data_lv
,gchar *cache_pool_lv
,GError **error
); gboolean bd_lvm_cache_create_cached_lv (gchar *vg_name
,gchar *lv_name
,guint64 data_size
,guint64 cache_size
,guint64 md_size
,BDLVMCacheMode mode
,BDLVMCachePoolFlags flags
,gchar **slow_pvs
,gchar **fast_pvs
,GError **error
); gboolean bd_lvm_cache_create_pool (gchar *vg_name
,gchar *pool_name
,guint64 pool_size
,guint64 md_size
,BDLVMCacheMode mode
,BDLVMCachePoolFlags flags
,gchar **fast_pvs
,GError **error
); gboolean bd_lvm_cache_detach (gchar *vg_name
,gchar *cached_lv
,gboolean destroy
,GError **error
); guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size
,GError **error
); BDLVMCacheMode bd_lvm_cache_get_mode_from_str (gchar *mode_str
,GError **error
); const gchar * bd_lvm_cache_get_mode_str (BDLVMCacheMode mode
,GError **error
); gchar * bd_lvm_cache_pool_name (gchar *vg_name
,gchar *cached_lv
,GError **error
); BDLVMCacheStats * bd_lvm_cache_stats (gchar *vg_name
,gchar *cached_lv
,GError **error
); gchar * bd_lvm_data_lv_name (gchar *vg_name
,gchar *lv_name
,GError **error
); gchar * bd_lvm_metadata_lv_name (gchar *vg_name
,gchar *lv_name
,GError **error
);
A plugin for operations with LVM. All sizes passed in/out to/from the functions are in bytes.
#define RESOLVE_PE_SIZE(size) ((size) == USE_DEFAULT_PE_SIZE ? BD_LVM_DEFAULT_PE_SIZE : (size))
typedef enum { BD_LVM_ERROR_PARSE, BD_LVM_ERROR_DM_ERROR, BD_LVM_ERROR_NOT_ROOT, BD_LVM_ERROR_CACHE_INVAL, BD_LVM_ERROR_CACHE_NOCACHE, } BDLVMError;
typedef struct { gchar *pv_name; gchar *pv_uuid; guint64 pe_start; gchar *vg_name; gchar *vg_uuid; guint64 vg_size; guint64 vg_free; guint64 vg_extent_size; guint64 vg_extent_count; guint64 vg_free_count; guint64 vg_pv_count; } BDLVMPVdata;
BDLVMPVdata * bd_lvm_pvdata_copy (BDLVMPVdata *data
);
Creates a new copy of data
.
typedef struct { gchar *name; gchar *uuid; guint64 size; guint64 free; guint64 extent_size; guint64 extent_count; guint64 free_count; guint64 pv_count; } BDLVMVGdata;
BDLVMVGdata * bd_lvm_vgdata_copy (BDLVMVGdata *data
);
Creates a new copy of data
.
typedef struct { gchar *lv_name; gchar *vg_name; gchar *uuid; guint64 size; gchar *attr; gchar *segtype; } BDLVMLVdata;
BDLVMLVdata * bd_lvm_lvdata_copy (BDLVMLVdata *data
);
Creates a new copy of data
.
typedef enum { BD_LVM_CACHE_MODE_WRITETHROUGH, BD_LVM_CACHE_MODE_WRITEBACK, BD_LVM_CACHE_MODE_UNKNOWN, } BDLVMCacheMode;
typedef enum { BD_LVM_CACHE_POOL_STRIPED = 1 << 0, BD_LVM_CACHE_POOL_RAID1 = 1 << 1, BD_LVM_CACHE_POOL_RAID5 = 1 << 2, BD_LVM_CACHE_POOL_RAID6 = 1 << 3, BD_LVM_CACHE_POOL_RAID10 = 1 << 4, BD_LVM_CACHE_POOL_META_STRIPED = 1 << 10, BD_LVM_CACHE_POOL_META_RAID1 = 1 << 11, BD_LVM_CACHE_POOL_META_RAID5 = 1 << 12, BD_LVM_CACHE_POOL_META_RAID6 = 1 << 13, BD_LVM_CACHE_POOL_META_RAID10 = 1 << 14, } BDLVMCachePoolFlags;
typedef struct { guint64 block_size; guint64 cache_size; guint64 cache_used; guint64 md_block_size; guint64 md_size; guint64 md_used; guint64 read_hits; guint64 read_misses; guint64 write_hits; guint64 write_misses; BDLVMCacheMode mode; } BDLVMCacheStats;
BDLVMCacheStats * bd_lvm_cache_stats_copy (BDLVMCacheStats *data
);
Creates a new copy of data
.
gboolean bd_lvm_is_supported_pe_size (guint64 size
,GError **error
);
|
size (in bytes) to test |
|
place to store error (if any). [out] |
Returns : |
whether the given size is supported physical extent size or not |
guint64 * bd_lvm_get_supported_pe_sizes (GError **error
);
|
place to store error (if any). [out] |
Returns : |
list of supported PE sizes. [transfer full][array zero-terminated=1] |
guint64 bd_lvm_get_max_lv_size (GError **error
);
|
place to store error (if any). [out] |
Returns : |
maximum LV size in bytes |
guint64 bd_lvm_round_size_to_pe (guint64 size
,guint64 pe_size
,gboolean roundup
,GError **error
);
|
size to be rounded |
|
physical extent (PE) size or 0 to use the default |
|
whether to round up or down (ceil or floor) |
|
place to store error (if any). [out] |
Returns : |
size rounded to pe_size according to the roundup
Rounds given size up/down to a multiple of pe_size according to the value
of the roundup parameter. If the rounded value is too big to fit in the
return type, the result is rounded down (floored) regardless of the roundup
parameter. |
guint64 bd_lvm_get_lv_physical_size (guint64 lv_size
,guint64 pe_size
,GError **error
);
|
LV size |
|
PE size |
|
place to store error (if any). [out] |
Returns : |
space taken on disk(s) by the LV with given size
Gives number of bytes needed for an LV with the size lv_size on an LVM stack
using given pe_size . |
guint64 bd_lvm_get_thpool_padding (guint64 size
,guint64 pe_size
,gboolean included
,GError **error
);
|
size of the thin pool |
|
PE size or 0 if the default value should be used |
|
if padding is already included in the size |
|
place to store error (if any). [out] |
Returns : |
size of the padding needed for a thin pool with the given size
according to the pe_size and included
|
gboolean bd_lvm_is_valid_thpool_md_size (guint64 size
,GError **error
);
|
the size to be tested |
|
place to store error (if any). [out] |
Returns : |
whether the given size is a valid thin pool metadata size or not |
gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size
,gboolean discard
,GError **error
);
|
the size to be tested |
|
whether discard/TRIM is required to be supported or not |
|
place to store error (if any). [out] |
Returns : |
whether the given size is a valid thin pool chunk size or not |
gboolean bd_lvm_pvcreate (gchar *device
,guint64 data_alignment
,guint64 metadata_size
,GError **error
);
|
the device to make PV from |
|
data (first PE) alignment or 0 to use the default |
|
size of the area reserved for metadata or 0 to use the default |
|
place to store error (if any). [out] |
Returns : |
whether the PV was successfully created or not |
gboolean bd_lvm_pvresize (gchar *device
,guint64 size
,GError **error
);
|
the device to resize |
|
the new requested size of the PV or 0 if it should be adjusted to device's size |
|
place to store error (if any). [out] |
Returns : |
whether the PV's size was successfully changed or not
If given size different from 0, sets the PV's size to the given value (see
pvresize(8)). If given size 0, adjusts the PV's size to the underlaying
block device's size. |
gboolean bd_lvm_pvremove (gchar *device
,GError **error
);
|
the PV device to be removed/destroyed |
|
place to store error (if any). [out] |
Returns : |
whether the PV was successfully removed/destroyed or not |
gboolean bd_lvm_pvmove (gchar *src
,gchar *dest
,GError **error
);
|
the PV device to move extents off of |
|
the PV device to move extents onto or NULL . [allow-none]
|
|
place to store error (if any). [out] |
Returns : |
whether the extents from the src PV where successfully moved or not
If dest is NULL , VG allocation rules are used for the extents from the src
PV (see pvmove(8)). |
gboolean bd_lvm_pvscan (gchar *device
,gboolean update_cache
,GError **error
);
|
the device to scan for PVs or NULL . [allow-none]
|
|
whether to update the lvmetad cache or not |
|
place to store error (if any). [out] |
Returns : |
whether the system or device was successfully scanned for PVs or not
The device argument is used only if update_cache is TRUE . Otherwise the
whole system is scanned for PVs. |
BDLVMPVdata ** bd_lvm_pvs (GError **error
);
|
place to store error (if any). [out] |
Returns : |
information about PVs found in the system. [array zero-terminated=1] |
gboolean bd_lvm_vgcreate (gchar *name
,gchar **pv_list
,guint64 pe_size
,GError **error
);
|
name of the newly created VG |
|
list of PVs the newly created VG should use. [array zero-terminated=1] |
|
PE size or 0 if the default value should be used |
|
place to store error (if any). [out] |
Returns : |
whether the VG name was successfully created or not |
gboolean bd_lvm_vgremove (gchar *vg_name
,GError **error
);
|
name of the to be removed VG |
|
place to store error (if any). [out] |
Returns : |
whether the VG was successfully removed or not Note: forces the VG removal. |
gboolean bd_lvm_vgactivate (gchar *vg_name
,GError **error
);
|
name of the to be activated VG |
|
place to store error (if any). [out] |
Returns : |
whether the VG was successfully activated or not |
gboolean bd_lvm_vgdeactivate (gchar *vg_name
,GError **error
);
|
name of the to be deactivated VG |
|
place to store error (if any). [out] |
Returns : |
whether the VG was successfully deactivated or not |
gboolean bd_lvm_vgextend (gchar *vg_name
,gchar *device
,GError **error
);
|
name of the to be extended VG |
|
PV device to extend the vg_name VG with |
|
place to store error (if any). [out] |
Returns : |
whether the VG vg_name was successfully extended with the given device or not. |
gboolean bd_lvm_vgreduce (gchar *vg_name
,gchar *device
,GError **error
);
|
name of the to be reduced VG |
|
PV device the vg_name VG should be reduced of or NULL
if the VG should be reduced of the missing PVs. [allow-none]
|
|
place to store error (if any). [out] |
Returns : |
whether the VG vg_name was successfully reduced of the given device or not |
BDLVMVGdata * bd_lvm_vginfo (gchar *vg_name
,GError **error
);
|
a VG to get information about |
|
place to store error (if any). [out] |
Returns : |
information about the vg_name VG or NULL in case
of error (the error ) gets populated in those cases). [transfer full]
|
BDLVMVGdata ** bd_lvm_vgs (GError **error
);
|
place to store error (if any). [out] |
Returns : |
information about VGs found in the system. [array zero-terminated=1] |
gchar * bd_lvm_lvorigin (gchar *vg_name
,gchar *lv_name
,GError **error
);
|
name of the VG containing the queried LV |
|
name of the queried LV |
|
place to store error (if any). [out] |
Returns : |
the origin volume for the vg_name /lv_name LV or
NULL if failed to determine (error ) is set in those cases). [transfer full]
|
gboolean bd_lvm_lvcreate (gchar *vg_name
,gchar *lv_name
,guint64 size
,gchar *type
,gchar **pv_list
,GError **error
);
|
name of the VG to create a new LV in |
|
name of the to-be-created LV |
|
requested size of the new LV |
|
type of the new LV ("striped", "raid1",..., see lvcreate (8)). [allow-none] |
|
list of PVs the newly created LV should use or NULL
if not specified. [allow-none][array zero-terminated=1]
|
|
place to store error (if any). [out] |
Returns : |
whether the given vg_name /lv_name LV was successfully created or not |
gboolean bd_lvm_lvremove (gchar *vg_name
,gchar *lv_name
,gboolean force
,GError **error
);
|
name of the VG containing the to-be-removed LV |
|
name of the to-be-removed LV |
|
whether to force removal or not |
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /lv_name LV was successfully removed or not |
gboolean bd_lvm_lvresize (gchar *vg_name
,gchar *lv_name
,guint64 size
,GError **error
);
|
name of the VG containing the to-be-resized LV |
|
name of the to-be-resized LV |
|
the requested new size of the LV |
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /lv_name LV was successfully resized or not |
gboolean bd_lvm_lvactivate (gchar *vg_name
,gchar *lv_name
,gboolean ignore_skip
,GError **error
);
|
name of the VG containing the to-be-activated LV |
|
name of the to-be-activated LV |
|
whether to ignore the skip flag or not |
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /lv_name LV was successfully activated or not |
gboolean bd_lvm_lvdeactivate (gchar *vg_name
,gchar *lv_name
,GError **error
);
|
name of the VG containing the to-be-deactivated LV |
|
name of the to-be-deactivated LV |
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /lv_name LV was successfully deactivated or not |
gboolean bd_lvm_lvsnapshotcreate (gchar *vg_name
,gchar *origin_name
,gchar *snapshot_name
,guint64 size
,GError **error
);
|
name of the VG containing the LV a new snapshot should be created of |
|
name of the LV a new snapshot should be created of |
|
name fo the to-be-created snapshot |
|
requested size for the snapshot |
|
place to store error (if any). [out] |
Returns : |
whether the snapshot_name snapshot of the vg_name /origin_name LV
was successfully created or not. |
gboolean bd_lvm_lvsnapshotmerge (gchar *vg_name
,gchar *snapshot_name
,GError **error
);
|
name of the VG containing the to-be-merged LV snapshot |
|
name of the to-be-merged LV snapshot |
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /snapshot_name LV snapshot was successfully merged or not |
BDLVMLVdata * bd_lvm_lvinfo (gchar *vg_name
,gchar *lv_name
,GError **error
);
|
name of the VG that contains the LV to get information about |
|
name of the LV to get information about |
|
place to store error (if any). [out] |
Returns : |
information about the vg_name /lv_name LV or NULL in case
of error (the error ) gets populated in those cases). [transfer full]
|
BDLVMLVdata ** bd_lvm_lvs (gchar *vg_name
,GError **error
);
|
name of the VG to get information about LVs from. [allow-none] |
|
place to store error (if any). [out] |
Returns : |
information about LVs found in the given
vg_name VG or in system if vg_name is NULL . [array zero-terminated=1]
|
gboolean bd_lvm_thpoolcreate (gchar *vg_name
,gchar *lv_name
,guint64 size
,guint64 md_size
,guint64 chunk_size
,gchar *profile
,GError **error
);
|
name of the VG to create a thin pool in |
|
name of the to-be-created pool LV |
|
requested size of the to-be-created pool |
|
requested metadata size or 0 to use the default |
|
requested chunk size or 0 to use the default |
|
profile to use (see lvm(8) for more information) or NULL to use
the default. [allow-none]
|
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /lv_name thin pool was successfully created or not |
gboolean bd_lvm_thlvcreate (gchar *vg_name
,gchar *pool_name
,gchar *lv_name
,guint64 size
,GError **error
);
|
name of the VG containing the thin pool providing extents for the to-be-created thin LV |
|
name of the pool LV providing extents for the to-be-created thin LV |
|
name of the to-be-created thin LV |
|
requested virtual size of the to-be-created thin LV |
|
place to store error (if any). [out] |
Returns : |
whether the vg_name /lv_name thin LV was successfully created or not |
gchar * bd_lvm_thlvpoolname (gchar *vg_name
,gchar *lv_name
,GError **error
);
|
name of the VG containing the queried thin LV |
|
name of the queried thin LV |
|
place to store error (if any). [out] |
Returns : |
the name of the pool volume for the vg_name /lv_name
thin LV or NULL if failed to determine (error ) is set in those cases). [transfer full]
|
gboolean bd_lvm_thsnapshotcreate (gchar *vg_name
,gchar *origin_name
,gchar *snapshot_name
,gchar *pool_name
,GError **error
);
|
name of the VG containing the thin LV a new snapshot should be created of |
|
name of the thin LV a new snapshot should be created of |
|
name fo the to-be-created snapshot |
|
name of the thin pool to create the snapshot in or NULL if not specified. [allow-none]
|
|
place to store error (if any). [out] |
Returns : |
whether the snapshot_name snapshot of the vg_name /origin_name
thin LV was successfully created or not. |
gboolean bd_lvm_set_global_config (gchar *new_config
,GError **error
);
|
string representation of the new global LVM
configuration to set or NULL to reset to default. [allow-none]
|
|
place to store error (if any). [out] |
Returns : |
whether the new requested global config new_config was successfully
set or not |
gchar * bd_lvm_get_global_config (GError **error
);
|
place to store error (if any). [out] |
Returns : |
a copy of a string representation of the currently set LVM global configuration |
gboolean bd_lvm_cache_attach (gchar *vg_name
,gchar *data_lv
,gchar *cache_pool_lv
,GError **error
);
|
name of the VG containing the data_lv and the cache_pool_lv LVs |
|
data LV to attache the cache_pool_lv to |
|
cache pool LV to attach to the data_lv
|
|
place to store error (if any). [out] |
Returns : |
whether the cache_pool_lv was successfully attached to the data_lv or not |
gboolean bd_lvm_cache_create_cached_lv (gchar *vg_name
,gchar *lv_name
,guint64 data_size
,guint64 cache_size
,guint64 md_size
,BDLVMCacheMode mode
,BDLVMCachePoolFlags flags
,gchar **slow_pvs
,gchar **fast_pvs
,GError **error
);
|
name of the VG to create a cached LV in |
|
name of the cached LV to create |
|
size of the data LV |
|
size of the cache (or cached LV more precisely) |
|
size of the cache metadata LV or 0 to use the default |
|
cache mode for the cached LV |
|
a combination of (ORed) BDLVMCachePoolFlags |
|
list of slow PVs (used for the data LV). [array zero-terminated=1] |
|
list of fast PVs (used for the cache LV). [array zero-terminated=1] |
|
place to store error (if any). [out] |
Returns : |
whether the cached LV lv_name was successfully created or not |
gboolean bd_lvm_cache_create_pool (gchar *vg_name
,gchar *pool_name
,guint64 pool_size
,guint64 md_size
,BDLVMCacheMode mode
,BDLVMCachePoolFlags flags
,gchar **fast_pvs
,GError **error
);
|
name of the VG to create pool_name in |
|
name of the cache pool LV to create |
|
desired size of the cache pool pool_name
|
|
desired size of the pool_name cache pool's metadata LV or 0 to
use the default |
|
cache mode of the pool_name cache pool |
|
a combination of (ORed) BDLVMCachePoolFlags |
|
list of (fast) PVs to create the pool_name
cache pool (and the metadata LV). [array zero-terminated=1]
|
|
place to store error (if any). [out] |
Returns : |
whether the cache pool vg_name /pool_name was successfully created or not |
gboolean bd_lvm_cache_detach (gchar *vg_name
,gchar *cached_lv
,gboolean destroy
,GError **error
);
|
name of the VG containing the cached_lv
|
|
name of the cached LV to detach its cache from |
|
whether to destroy the cache after detach or not |
|
place to store error (if any). [out] |
Returns : |
whether the cache was successfully detached from the cached_lv or not
Note: synces the cache first |
guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size
,GError **error
);
|
size of the cache to determine MD size for |
|
place to store error (if any). [out] |
Returns : |
recommended default size of the cache metadata LV or 0 in case of error |
BDLVMCacheMode bd_lvm_cache_get_mode_from_str (gchar *mode_str
,GError **error
);
|
string representation of a cache mode |
|
place to store error (if any). [out] |
Returns : |
cache mode for the mode_str or BD_LVM_CACHE_MODE_UNKNOWN if
failed to determine |
const gchar * bd_lvm_cache_get_mode_str (BDLVMCacheMode mode
,GError **error
);
|
mode to get the string representation for |
|
place to store error (if any). [out] |
Returns : |
string representation of mode or NULL in case of error |
gchar * bd_lvm_cache_pool_name (gchar *vg_name
,gchar *cached_lv
,GError **error
);
|
name of the VG containing the cached_lv
|
|
cached LV to get the name of the its pool LV for |
|
place to store error (if any). [out] |
Returns : |
name of the cache pool LV used by the cached_lv or NULL in case of error |
BDLVMCacheStats * bd_lvm_cache_stats (gchar *vg_name
,gchar *cached_lv
,GError **error
);
|
name of the VG containing the cached_lv
|
|
cached LV to get stats for |
|
place to store error (if any). [out] |
Returns : |
stats for the cached_lv or NULL in case of error |
gchar * bd_lvm_data_lv_name (gchar *vg_name
,gchar *lv_name
,GError **error
);
|
name of the VG containing the queried LV |
|
name of the queried LV |
|
place to store error (if any). [out] |
Returns : |
the name of the (internal) data LV of the
vg_name /lv_name LV. [transfer full]
|
gchar * bd_lvm_metadata_lv_name (gchar *vg_name
,gchar *lv_name
,GError **error
);
|
name of the VG containing the queried LV |
|
name of the queried LV |
|
place to store error (if any). [out] |
Returns : |
the name of the (internal) metadata LV of the
vg_name /lv_name LV. [transfer full]
|