Loading...
Searching...
No Matches
reduce.h File Reference

SPDK block compression. More...

Data Structures

struct  spdk_reduce_vol_params
 Describes the parameters of an spdk_reduce_vol. More...
 
struct  spdk_reduce_vol_cb_args
 
struct  spdk_reduce_backing_io
 
struct  spdk_reduce_backing_dev
 

Macros

#define REDUCE_MAX_IOVECS   33
 

Typedefs

typedef void(* spdk_reduce_vol_op_complete) (void *ctx, int reduce_errno)
 
typedef void(* spdk_reduce_vol_op_with_handle_complete) (void *ctx, struct spdk_reduce_vol *vol, int reduce_errno)
 
typedef void(* spdk_reduce_dev_cpl) (void *cb_arg, int reduce_errno)
 Defines function type for callback functions called when backing_dev operations are complete.
 

Enumerations

enum  spdk_reduce_backing_io_type { SPDK_REDUCE_BACKING_IO_WRITE , SPDK_REDUCE_BACKING_IO_READ , SPDK_REDUCE_BACKING_IO_UNMAP }
 

Functions

const struct spdk_uuidspdk_reduce_vol_get_uuid (struct spdk_reduce_vol *vol)
 Get the UUID for a libreduce compressed volume.
 
void spdk_reduce_vol_init (struct spdk_reduce_vol_params *params, struct spdk_reduce_backing_dev *backing_dev, const char *pm_file_dir, spdk_reduce_vol_op_with_handle_complete cb_fn, void *cb_arg)
 Initialize a new libreduce compressed volume.
 
void spdk_reduce_vol_load (struct spdk_reduce_backing_dev *backing_dev, spdk_reduce_vol_op_with_handle_complete cb_fn, void *cb_arg)
 Load an existing libreduce compressed volume.
 
void spdk_reduce_vol_unload (struct spdk_reduce_vol *vol, spdk_reduce_vol_op_complete cb_fn, void *cb_arg)
 Unload a previously initialized or loaded libreduce compressed volume.
 
void spdk_reduce_vol_destroy (struct spdk_reduce_backing_dev *backing_dev, spdk_reduce_vol_op_complete cb_fn, void *cb_arg)
 Destroy an existing libreduce compressed volume.
 
void spdk_reduce_vol_readv (struct spdk_reduce_vol *vol, struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length, spdk_reduce_vol_op_complete cb_fn, void *cb_arg)
 Read data from a libreduce compressed volume.
 
void spdk_reduce_vol_writev (struct spdk_reduce_vol *vol, struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length, spdk_reduce_vol_op_complete cb_fn, void *cb_arg)
 Write data to a libreduce compressed volume.
 
const struct spdk_reduce_vol_paramsspdk_reduce_vol_get_params (struct spdk_reduce_vol *vol)
 Get the params structure for a libreduce compressed volume.
 
void spdk_reduce_vol_print_info (struct spdk_reduce_vol *vol)
 Dump out key information for a libreduce compressed volume and its PMEM.
 
const char * spdk_reduce_vol_get_pm_path (const struct spdk_reduce_vol *vol)
 Get the pm path for a libreduce compressed volume.
 

Detailed Description

SPDK block compression.

Typedef Documentation

◆ spdk_reduce_dev_cpl

typedef void(* spdk_reduce_dev_cpl) (void *cb_arg, int reduce_errno)

Defines function type for callback functions called when backing_dev operations are complete.

Parameters
cb_argCallback argument
reduce_errnoCompletion status of backing_dev operation Negative values indicate negated errno value 0 indicates successful readv/writev/unmap operation Positive value indicates successful compress/decompress operations; number indicates number of bytes written to destination iovs

Function Documentation

◆ spdk_reduce_vol_destroy()

void spdk_reduce_vol_destroy ( struct spdk_reduce_backing_dev * backing_dev,
spdk_reduce_vol_op_complete cb_fn,
void * cb_arg )

Destroy an existing libreduce compressed volume.

This will zero the metadata region on the backing device and delete the associated pm metadata file. If the backing device does not contain a compressed volume, the cb_fn will be called with error status without modifying the backing device nor deleting a pm file.

Parameters
backing_devStructure describing the backing device containing the compressed volume.
cb_fnCallback function to signal completion of the destruction process.
cb_argArgument to pass to the callback function.

◆ spdk_reduce_vol_get_params()

const struct spdk_reduce_vol_params * spdk_reduce_vol_get_params ( struct spdk_reduce_vol * vol)

Get the params structure for a libreduce compressed volume.

This function will populate the given params structure for a given volume.

Parameters
volPreviously loaded or initialized compressed volume.
Returns
params structure for the compressed volume.

◆ spdk_reduce_vol_get_pm_path()

const char * spdk_reduce_vol_get_pm_path ( const struct spdk_reduce_vol * vol)

Get the pm path for a libreduce compressed volume.

Parameters
volPreviously loaded or initialized compressed volume.
Returns
pm path for the compressed volume.

◆ spdk_reduce_vol_get_uuid()

const struct spdk_uuid * spdk_reduce_vol_get_uuid ( struct spdk_reduce_vol * vol)

Get the UUID for a libreduce compressed volume.

Parameters
volPreviously loaded or initialized compressed volume.
Returns
UUID for the compressed volume.

◆ spdk_reduce_vol_init()

void spdk_reduce_vol_init ( struct spdk_reduce_vol_params * params,
struct spdk_reduce_backing_dev * backing_dev,
const char * pm_file_dir,
spdk_reduce_vol_op_with_handle_complete cb_fn,
void * cb_arg )

Initialize a new libreduce compressed volume.

Parameters
paramsParameters for the new volume.
backing_devStructure describing the backing device to use for the new volume.
pm_file_dirDirectory to use for creation of the persistent memory file to use for the new volume. This function will append the UUID as the filename to create in this directory.
cb_fnCallback function to signal completion of the initialization process.
cb_argArgument to pass to the callback function.

◆ spdk_reduce_vol_load()

void spdk_reduce_vol_load ( struct spdk_reduce_backing_dev * backing_dev,
spdk_reduce_vol_op_with_handle_complete cb_fn,
void * cb_arg )

Load an existing libreduce compressed volume.

Parameters
backing_devStructure describing the backing device containing the compressed volume.
cb_fnCallback function to signal completion of the loading process.
cb_argArgument to pass to the callback function.

◆ spdk_reduce_vol_print_info()

void spdk_reduce_vol_print_info ( struct spdk_reduce_vol * vol)

Dump out key information for a libreduce compressed volume and its PMEM.

This function will print key information for a given volume its PMEM.

Parameters
volPreviously loaded or initialized compressed volume.

◆ spdk_reduce_vol_readv()

void spdk_reduce_vol_readv ( struct spdk_reduce_vol * vol,
struct iovec * iov,
int iovcnt,
uint64_t offset,
uint64_t length,
spdk_reduce_vol_op_complete cb_fn,
void * cb_arg )

Read data from a libreduce compressed volume.

This function will only read from logical blocks on the comparessed volume that fall within the same chunk.

Parameters
volVolume to read data.
ioviovec array describing the data to be read
iovcntNumber of elements in the iovec array
offsetOffset (in logical blocks) to read the data on the compressed volume
lengthLength (in logical blocks) of the data to read
cb_fnCallback function to signal completion of the readv operation.
cb_argArgument to pass to the callback function.

◆ spdk_reduce_vol_unload()

void spdk_reduce_vol_unload ( struct spdk_reduce_vol * vol,
spdk_reduce_vol_op_complete cb_fn,
void * cb_arg )

Unload a previously initialized or loaded libreduce compressed volume.

Parameters
volVolume to unload.
cb_fnCallback function to signal completion of the unload process.
cb_argArgument to pass to the callback function.

◆ spdk_reduce_vol_writev()

void spdk_reduce_vol_writev ( struct spdk_reduce_vol * vol,
struct iovec * iov,
int iovcnt,
uint64_t offset,
uint64_t length,
spdk_reduce_vol_op_complete cb_fn,
void * cb_arg )

Write data to a libreduce compressed volume.

This function will only write to logical blocks on the comparessed volume that fall within the same chunk.

Parameters
volVolume to write data.
ioviovec array describing the data to be written
iovcntNumber of elements in the iovec array
offsetOffset (in logical blocks) to write the data on the compressed volume
lengthLength (in logical blocks) of the data to write
cb_fnCallback function to signal completion of the writev operation.
cb_argArgument to pass to the callback function.